proc archimedes() { string $cmd = "curve -d 3 -p 0 0 0"; // Setup our basic spiral curve string int $k = 3; // Number of turns $k = $k * 360; // Convert turns into total degrees float $resolution = 20; // How many degrees before each new edit point. Between 0 and 359 float $a = 0; // initial spin (in degrees - set from 0 to 359) $a = deg_to_rad($a); // Convert initial spin to radians float $b = 1; // Distance between successive spirals for ( $i = 0; $i < $k; $i = $i + $resolution ) { $theta = deg_to_rad($i); // Convert degrees to radians $x = $b * ($theta * cos($theta + $a)); $y = $b * ($theta * sin($theta + $a)); $cmd = ($cmd + " -p " + $x + " " + $y + " " + 0); // Following loops ensure that 5 identical points are created at the end of the spiral to ensure the line does not tail off. if ( $i == ($k - $resolution)) { for ( $foo = 0; $foo < 3; $foo = $foo + 1 ) { $cmd = ($cmd + " -p " + $x + " " + $y + " " + 0); } } print $cmd; } eval($cmd); } archimedes();