00:02
All right.
00:03
So let's say above these little hashtags here, right, we already have this function that uses turtle to draw a line.
00:12
And it draws a line between some coordinates x1, y1 to x2, y2.
00:16
Let's say we already have this function.
00:18
What we're going to focus on is below these hash marks, right? so what we want to do is draw a star.
00:28
And it's helpful actually to draw a pentagon first and then.
00:34
Update it and i'll kind of explain why in a second.
00:40
So when you have a pentagon, you could think of it as it being a bunch of points, five points, evenly distributed on a circle, right? they have equal spacing on the circle, right? and so what that means is we have to divide the circle up into five equal angles, right? and if we draw a line between each point on that circle, we'll get a pentagon.
01:07
So the idea is that each angle is going to be 2 pi over 5 distance from each other, right? so you start with 2 pi over 5, then you get 4 pi over 5, right? then 6 pi over 5.
01:20
You're just adding 2 pi over 5, and then eventually you end up back at 2 pi.
01:24
And so let's say each time we go through a loop 5 times for each stroke, we start at 2 pi i over 5, and we go to 2 pi i plus 1 over 5, right? so from one angle to the next angle, and we do it 5 times...