$origin_x = 110; $origin_y = 70; # origin of the spiral $PI = 3.1415926535; $circle_radius = 5; # radius of the first circle $path_radius = 0; for ($angle = 0; $angle <= 180; $path_radius += 7, $circle_radius += 3, $angle += 4) { # offset of path coordinates: r.cos() and r.sin() # sin() and cos() like their angles in radians (degrees*/90) $path_x = $origin_x + $path_radius * cos ($angle * $PI / 90); $path_y = $origin_y - $path_radius * sin ($angle * $PI / 90); # path_x and path_y are the coordinates of the center of the new # circle. Canvas::create likes top-left and bottom-right corners $canvas->createOval ( $path_x - $circle_radius, $path_y - $circle_radius, $path_x + $circle_radius, $path_y + $circle_radius, -fill => 'yellow' ); $canvas->createLine ( $origin_x, $origin_y, $path_x, $path_y, -fill => 'slategray'); } MainLoop();