arcRight

Category:Turtle

arcRight(angle, radius)

Category: Turtle

Moves the turtle forward and to the right in a smooth circular arc.

The turtle is not limited to only moving in a straight line. arcRight(angle,radius) moves the turtle clockwise along an angle degree arc of a radius sized circle. The center of the circle is radius pixels to the right of the starting turtle position and direction.

Examples


// Draw a quarter circle clockwise.
arcRight(90, 25);

Example: Frown Draw a frown to the right.

// Draw a frown to the right.
penWidth(10);
arcRight(180, 50);

Example: U-Turn Smoothly turn the turtle around.

// Smoothly turn the turtle around.
arcLeft(60, 25);    // Turn left a bit
arcRight(300, 25);  // Turn almost all the way
arcLeft(60, 25);    // Straighten out

Example: Radioactive Draw the radioactive symbol by coloring in segments of a circle using arcRight and small changes in radius.

// Draw the radioactive symbol by coloring in segments of a circle using arcRight and small changes in radius.
hide();
penWidth(1);
for (var radius=50; radius>0; radius=radius-1) {
  for (var count=1; count<=3; count++) {
    penColor("yellow");
    arcRight(60, radius);
    penColor("black");
    arcRight(60, radius);
  }
  move(1,0);
}
penColor("yellow");
dot(15);
penColor("black");
dot(10);

Syntax

arcRight(angle, radius);

Parameters

Name Type Required? Description
angle number Yes The angle degree arc to move the turtle clockwise in a circle.
radius number Yes The radius of the circle that is placed right of the turtle. radius must be >= 0.

Returns

No return value. Moves turtle only.

Tips

  • Use penUp() before calling arcLeft() to have the turtle not draw as it moves.
  • You can specify a radius of 0, which makes arcRight() act the same as turnRight().
  • Use alternating with arcLeft() to make wavy lines.

Found a bug in the documentation? Let us know at documentation@code.org

Found a bug in the documentation? Let us know at documentation@code.org