spiral.frink

Download or view spiral.frink in plain text format


// Simple program to draw spirals.  Change the step or the equation
// to make vastly different graphs.

incr=eval[input["Enter degrees between sides: ", 30]] degrees;
g = new graphics
p = new polyline
g.stroke[2]

extent = 100.1 circles

for theta = 0 degrees to extent step incr
{
    r = theta                   // Change this to make different graphs
    x = r cos[theta]            // Convert polar to rectangular coordinates
    y = r sin[theta]
    p.addPoint[x, y]
}

g.add[p]    // Add polyline to the graphics object
g.show[]


Download or view spiral.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 19965 days, 13 hours, 35 minutes ago.