
The Archimedean spiral is a spiral named after the Greek mathematician Archimedes.



An Archimedean spiral can be described by the equation:






r
=
a
+
b
θ


{\displaystyle \,r=a+b\theta }


with real numbers a and b.



Task
Draw an Archimedean spiral.




$ include "seed7_05.s7i";
  include "draw.s7i";
  include "keybd.s7i";
 
const proc: main is func
  local
    const float: xCenter is 117.0;
    const float: yCenter is 139.0;
    const float: maxTheta is 10.0 * PI;
    const float: delta is 0.01;
    const float: a is 1.0;
    const float: b is 7.0;
    var float: theta is 0.0;
    var float: radius is 0.0;
  begin
    screen(256, 256);
    clear(curr_win, black);
    KEYBOARD := GRAPH_KEYBOARD;
    while theta <= maxTheta do
      radius := a + b * theta;
      point(round(xCenter + radius * cos(theta)),
            round(yCenter - radius * sin(theta)), white);
      theta +:= delta;
    end while;
    DRAW_FLUSH;
    ignore(getc(KEYBOARD));
  end func;