RegularPolygon returns a regular polygon with radius r. It uses n vertices/edges, so when n approaches infinity this will return a path that approximates a circle. n must be 3 or more. The up boolean defines whether the first point will point upwards or downwards.
(n int, r float64, up bool)
| 121 | |
| 122 | // RegularPolygon returns a regular polygon with radius r. It uses n vertices/edges, so when n approaches infinity this will return a path that approximates a circle. n must be 3 or more. The up boolean defines whether the first point will point upwards or downwards. |
| 123 | func RegularPolygon(n int, r float64, up bool) *Path { |
| 124 | return RegularStarPolygon(n, 1, r, up) |
| 125 | } |
| 126 | |
| 127 | // RegularStarPolygon returns a regular star polygon with radius r. It uses n vertices of density d. This will result in a self-intersection star in counter clockwise direction. If n/2 < d the star will be clockwise and if n and d are not coprime a regular polygon will be obtained, possible with multiple windings. n must be 3 or more and d 2 or more. The up boolean defines whether the first point will point upwards or downwards. |
| 128 | func RegularStarPolygon(n, d int, r float64, up bool) *Path { |