Help a newbie with Penrose tilling

Hello guys, i have been trying to draw this Penrose tile, I already got the pentagon but now i’m stuck with the other figure. Any help? I’m new to this.

Capture

By the way here’s the code:

void setup(){
size(400,400);
}
void draw(){
beginShape();
vertex(100,100);
vertex(140,100);
vertex(140+40sin(0.314159),100-40cos(0.314159));
vertex(120,100-40cos(0.314159)-40cos(0.942478));
vertex(100-40sin(0.314159),100-40cos(0.314159));
vertex(100,100);;
endShape();
}

1 Like

I just love that you have the diagram there that details the math for these shapes.

Here’s a couple of them drawn.

Notice the use of translate() to position them.

float a;
float phi = 50 + 50 * sqrt(5.0);
float one = 100;

void setup() {
  size(400, 400);
  noFill();
}

void draw() {
  background(0);

  translate(30, height-30);

  stroke(0,200,0);
  beginShape();
    vertex(0,0);
    vertex(phi,0);
    vertex(phi*cos(-radians(36)),phi*sin(-radians(36)));
    vertex(phi*cos(-radians(72)),phi*sin(-radians(72)));
  endShape(CLOSE);

  translate(5,-5);

  stroke(0,0,200);
  beginShape();
    vertex(phi,0);
    vertex(phi*cos(-radians(36)),phi*sin(-radians(36)));
    vertex(phi*cos(-radians(72)),phi*sin(-radians(72)));
    vertex((phi+one)*cos(-radians(36)),(phi+one)*sin(-radians(36)));
  endShape(CLOSE);

}
1 Like

I see, thanks, i would have to put them inside the pentagon, which is what is bugging me out

Man, i was doing that test with him, i rlly love you, you will go to heaven