Draw a series of connected polygons like the one shown above.
However, what the above picture does not show is the spiral formed by consecutive vertexes:
The limitation of these is that there is only 1 spiral marked. You should mark all the spirals. This can be done by rotating each spiral shown above so that there is a spiral starting at each vertex of the largest polygon.
The spirals should all be one color, while the rest of the picture another.
The innermost polygon should be entirely the color of the spiral.
Rules
- You will receive the arguments { n, s, p, a } in a function or program
- n = iterations inward (number of polygons)
- s = sides of the (regular) polygon (you may assume n>=3)
- p = (the linear distance from a vertex of polygon A to its corresponding counter-clockwise "inner" vertex) / (the total length of A's side). So for the diagram, p would be about 1/3 because each inner polygon meets the larger polygon's side at about 1/3 of the way through that side.
- a = the radius (circumscribing) of the exterior polygon
The limit of any of the values of n,s,p or a are based on what can be perceived as this kind of drawing by a human. (e.g. no shaded circles) as well as common sense (s>=3,n>=1)
Happy golfing! Shortest program wins.
p
linear in angle or in distance between two vertices? \$\endgroup\$s
anticlockwise red spirals. However, what remains would bes
clockwise black spirals! StretchManiac, this is a good question but we really need an example picture to see what you mean. Upvoting and closevoting. \$\endgroup\$