Polyspiral

From Rosetta Code
Revision as of 00:26, 9 March 2016 by rosettacode>Fwend (created Polyspiral draft task)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Polyspiral is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

A Polyspiral is a spiral made of multiple line segments, whereby each segment is larger (or smaller) than the previous one by a given amount. Each segment also changes direction at a given angle.

The task: animate a series of polyspirals, by drawing a complete spiral then incrementing the angle, and (after clearing the background) drawing the next, and so on.

WHILE true

    x = width / 2
    y = height / 2
    set length

    FOR 1 TO 150
        drawline
        change direction by angle
        increment length
    ENDFOR

    increment angle MOD 360

If animation is not practical in your programming environment, you may show 3 frames from different stages of the animation instead.