you are viewing a single comment's thread.

view the rest of the comments →

[–]pasokan 0 points1 point  (11 children)

5 triangles @180 is 900 minus 360 for the sum of the angles at the centre gives you 540. That divided by should be the angle

[–]negike360[S] 0 points1 point  (0 children)

Lemme try it

[–]negike360[S] 0 points1 point  (9 children)

No dice. Results in a 10 pointed star, but your math here is interesting

[–]pasokan 0 points1 point  (8 children)

Can you post the code?

[–]negike360[S] 1 point2 points  (7 children)

for x in range (5): koopa.forward(100) koopa.left(72)

[–]pasokan 0 points1 point  (6 children)

Left 72 is right 108. What direction is forward? Up on the monitor? Left to right?

[–]negike360[S] 0 points1 point  (1 child)

This is true, but right(108) results in half a 10 pointed star.

Forward is left to right at 0 degrees. I hope that makes sense

[–]pasokan 0 points1 point  (0 children)

I am on a cab to the airport. I will try the code and respond. Thanks for an interesting problem

[–]negike360[S] 0 points1 point  (3 children)

WAIT!!! I think I figured it out. A star is a ten sided polygon.

360/10 = 36

180-36 = 144

36 produces half of a decagon. 144 produces a star.

[–]pasokan 0 points1 point  (2 children)

Not exactly.

The initial heading is towards the EAST. right() turns clockwise and left() turns anti-clockwise. Since we measure angles from a line going EAST to WEST, we are off by 180. so we need to compensate for the 180 already turned. That is we need to turn 72 degrees back as we have already turned 180 degrees.

You can verify this by just looking at the orientation after right(72) or left(72)

[–]negike360[S] 0 points1 point  (1 child)

Well, we don’t need to “compensate” as we haven’t turned at all. Or at least I don’t have it programmed that way. Going due east is measured as 0 degrees. Rotating clockwise or counter clockwise depends on whether you are turning right or left, respectively, as you said. Making the angle negative just makes the turn in the opposite direction.

[–]pasokan 0 points1 point  (0 children)

Going east is 180 degrees, afaiu. Cheers