spiral.frink

View or download 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[]


View or download 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 17478 days, 1 hours, 24 minutes ago.