Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

How to Draw N-sided Regular Polygons [8/11]

8. Drawing the Regular Star Polygons

To draw the regular star septagon, the number of sides n must be set to 7. An additional variable is required, named skip, which tells how many vertices to skip over during iteration.
[Run the program]

The computation of the angle has been modified compared to the previous page. The value skip is now employed to compute the angle.

No other major changes are required to draw the regular star septagon.
[Run the program]

If you like this tutorial, you can use the gray sharing buttons to share it with your friends. The sharing buttons create a link to the current page. The buttons for Twitter, Facebook, Pinterest, Reddit and LinkedIn are provided.

The next page adds a simple animation.

Loading...