PencilCoder

Coordinates!

Goals:

  • Use absolute and relative coordinates to make your sprites move and to draw complex diagrams more easily

Coding Snippets:

  • coding snippets
  • moveto and jumpto use absolute coordinates, e.g., moveto 50, 0 moves the sprite to location (50,0).
  • movexy, jumpxy, and slide use relative coordinates, e.g., movexy 50, 0 moves the sprite 50 units in the positive x direction from its current location.
  • jumpto and jumpxy move the sprite without drawing a line (regardless of whether the pen is down or not)
  • moveto and movexy move the sprite while drawing a line (if the pen is down).

Math and Computer Concepts:

  • The screen is structured just like the Cartesian coordinate system used in math class. The center of the grid—where the default turtle starts—is called the origin, and has the (x,y) value (0,0).
  • Every sprite begins facing "north", which is direction 0. Direction 90 is "east", 180 is "south", 270 is "west", and so on.
  • When designing with coordinates, it can be helpful to sketch a drawing on graph paper before typing it up as code.

Activities:

Save each of the following in a folder called Coordinates.