Create an OpenGL program that draws a five-pointed star.
Details
Use a triangle fan where the fist point is the center of the star.
The points of the star are on a circle. So the points can be computed using the equations:
\[x = cos(\theta) \cdot radius\] \[y = sin(\theta) \cdot radius\]
Where thea is the angle of rotation from the point (radius, 0) that the point is located.
The inner points of the star are also on a circle. This circle’s radius is:
\[inner\_radius = outer\_radius \cdot sin(18\circ) / sin(136\circ)\]