Turtle Graphics - Arcs and Shapes
[Index] [<< Previous section: Stroking and Filling Paths] [Next section: Adding Shadow >>]
arc angle radius
- Description: draws an arc of a circle, with the turtle at the center, with the specified
radius
, starting at the turtle's heading and extending clockwise through the specifiedangle
.- Note: the turtle is not moving while drawing the arc.
- Example 1:
arc 90 100
- Example 2: drawing a circle with a radius of 50 pixels:
arc 360 50
- Note: the turtle is not moving while drawing the arc.
circle radius
- Description: draws a circle, with the turtle at the center, with the specified
radius
.- Note: the turtle is not moving while drawing the circle.
- Example:
circle 50
- Note: the turtle is not moving while drawing the circle.
fillcircle radius
- Description: fills a circle, with the turtle at the center, with the specified
radius
.- Note: the turtle is not moving while filling the circle.
- Example:
setfillcolor "magenta
fillcircle 50 - Note: the turtle is not moving while filling the circle.
rect width height rotation
- Description: draws a rectangle with the specified
width
andheight
and the turtle at the center. If therotation
parameter is set to true, the rectangle is rotated by the turtle's heading.- Note: the turtle is not moving while drawing the rectangle.
- Example 1:
left 45
rect 60 100 false- Example 2:
left 45
rect 60 100 true - Note: the turtle is not moving while drawing the rectangle.
fillrect width height rotation
- Description: fills a rectangle with the specified
width
andheight
and the turtle at the center. If therotation
parameter is set to true, the rectangle is rotated by the turtle's heading.- Note: the turtle is not moving while filling the rectangle.
- Example 1:
left 45
setfillcolor "cyan
fillrect 60 100 false
- Example 2:
left 45
setfillcolor "cyan
fillrect 60 100 true
- Note: the turtle is not moving while filling the rectangle.
[Index] [<< Previous section: Stroking and Filling Paths] [Next section: Adding Shadow >>]