Get turtle's move direction

movedir

Returns a direction vector according to which the move instruction is performing steps. Note: forward step and back step instructions are changing move direction to heading before the step is done.

Example:

repeat 8 [
  (print heading movedir)
  setmovedir array cos heading-90 cos heading
  move 30
  right 45
]

Output:
(also a drawing)

0 {0 1}
45 {6.12303176911189E-17 1}
90 {0.707106781186548 0.707106781186548}
135 {1 6.12303176911189E-17}
180 {0.707106781186548 -0.707106781186547}
-135 {6.12303176911189E-17 -1}
-90 {-0.707106781186548 -0.707106781186547}
-45 {-1 6.12303176911189E-17}

See also:

Table of Content