Reference › Movement and Pose — 110 commands


anchor

movement and pose

Input: none
Output: list

Returns the location of the current anchor. The anchor is the 'pivot point' of the orbit commands and pullin / pullout.

show anchor

around

movement and pose

Input: position (list) | vector (list) | length (number) | radius (number)
Output: turtles (list)

Returns a list of turtles within the cylinder created by the given parameters, in the direction indicated by the vector away from the position with the given length and radius. Useful for collision detection. See also inside, encroaching.

snappy:show without turtle around position forwarddir 200 20
[myrtle]

autoorbit

movement and pose

Input: direction (word) | degrees (number) | time (60ths of a second)
Output: none

Automatically orbits the current view turtle in the specified direction the specified number of degrees every specified 60ths of a second. noautoorbit turns it off. Subsequent autoorbits cancel previous ones.

autoorbit "left 2 5
autoorbit "up 0.5 10

back

Also: bk

movement and pose

Input: turtlesteps (number)
Output: none

Moves the current turtle back the specified number of turtle steps.

back 20

barriers

movement and pose

Input: none
Output: list

Lists the existing barriers. See setbarriers

show barriers

direction

movement and pose

Input: position (list)
Output: vectors (list)

Returns a list of vectors that would point the calling turtle at the supplied list of co-ordinates.

show direction myrtle:position snappy:position
[[0 1 0] [0 0 1] [1 0 0]]
snappy:setvectors direction myrtle:position

distance

movement and pose

Input: position (list) | position (list)
Output: distance (number)

Returns the distance from the first given set of co-ordinates to the second given set of co-ordinates. distance can use [X Y Z] list or [X Y] list, assuming 0Z

show distance myrtle:position snappy:position
show distance [0 0 0] [100 100 100]

divergence

movement and pose

Input: [vector1 vector2] (list) | [vector3 vector4] (list)
Output: degrees (number)

Divergence returns the degrees of difference (divergence) between vector1 and vector3 in a clockwise direction, that direction established using vector2 and vector4, which need to be the axis you would be pivoting on to measure that difference. So if you're measuring the degrees of difference between two forward vectors in terms of left and right, the second vector needs to be the up vector. If you were measuring the difference in terms of up and down, you would give the right vector. Divergence is extremely useful for ball games.

show divergence {item 1 myrtle:vectors item 3 myrtle:vectors} {item 1 snappy:vectors item 3 myrtle:vectors}
90

down

Also: dn

movement and pose

Input: degrees (number)
Output: none

Tilts the calling turtle's nose down by the given number of degrees. See up

down 45

drift

movement and pose

Input: steps vector
Output: none

Causes the selected turtle to 'drift' the specified number of steps in the direction specified by vector. You can use drift to simulate momentum or gravity, particularly in concert with workers. See forwarddir

drift 10 forwarddir
forward 10 make "forward forwarddir newworker [repeat 5 [drift 1 :forward]]

dropanchor

movement and pose

Input: none
Output: none

Sets the selected turtle's orbit anchor point to its current position. See setanchor

repeat 10 [penup forward 60 dropanchor pullout 50 pendown repeat 36 [orbitleft 10]]

encroaching

movement and pose

Input: position (list) | vectors (list) | [left right forward backward above below] (list)
Output: turtles (list)

Returns a list of turtles encroaching within the 'box' specified by the third list input. This is a more sophisticated version of inside, which allows for a box of any orientation, based on the provided vectors. See around, inside

show encroaching position vectors [10 10 10 10 10]

extrapolate

movement and pose

Input: position (list) | vector (list) | distance (number)
Output: list

Returns a list of target co-ordinates based on the starting position, a vector and the distance in turtle-units along that vector.

show extrapolate position forwarddir 5

face

movement and pose

Input: position (list of 3) | position (list of 3)
Output: vector (list)

face takes two lists of co-ordinates (x, y and z) and then returns a list of vectors (list of three lists of three) which if applied to a turtle cause it to 'face' the second set of co-ordinates if positioned at the first set of co-ordinates.

setvectors face position [100 100 100]

facingp

movement and pose

Input: co-ordinates (list) | degrees (number)
Output: boolean

returns true if a vector from the calling turtle to the supplied co-ordinates diverges less than the supplied number of degrees from the calling turtle's forward vector. See divergence

reset
snappy:show facingp myrtle:position 10
true
myrtle:show facingp snappy:position 10
false

fence

movement and pose

Input: none
Output: none

Causes the calling turtle to halt if it reaches the screen boundaries set by setbounds. See setbounds, bounds, window, wrap, hitboundsp

setbounds [-50 -50 50 50] fence
forward 40
show list ypos fencep

fixate

Also: fix

movement and pose

Input: position
Output: none

Both sets the anchor point and points the selected turtle at it. Compare with setanchor, which does not change the orientation of the selected turtle.

snappy:fixate myrtle:position
fixate [0 0 0]
points Snappy (the camera turtle) at Myrtle.

forward

Also: fd

movement and pose

Input: turtle-spaces (number)
Output: none

Moves the turtle forward the given number of turtle steps. Draws a line if the pen is down. See pendown, back

forward 20

forwarddir

movement and pose

Input: none
Output: vector (list)

Returns the calling turtle's forward vector. See backdir

show forwarddir

backdir

movement and pose

Input: none
Output: vector (list)

Returns the calling turtle's back vector. See forwarddir

show backdir

heading

Also: hd

movement and pose

Input: none
Output: degrees

Returns the heading (x-axis) of the selected turtle in degrees. Heading is an accumulated, relative value that cannot be used in isolation to accurately reproduce an orientation when the turtle moves in three dimensions - for that, use orientation / setorientation. See pitch and roll

print heading

home

movement and pose

Input: none
Output: none

Returns the currently selected turtle to the home position.

forward 80 right 90 forward 40
home
show pos

inside

movement and pose

Input: [[x1 y1 z1] [x2 y2 z2]]
Output: list

Returns a list of turtles inside the area denoted by the provided sets of co-ordinates.

show inside [[-100 -100 -100] [100 100 100]
[myrtle]

jump

movement and pose

Input: steps (number)
Output: none

Moves the turtle forward the given number of turtle steps without drawing, regardless of the pen state.

jump 20

left

Also: lt

movement and pose

Input: degrees
Output: none

Turns the selected turtle to the left the specified number of degrees. See right

left 90
lt 45

leftarc

Also: larc

movement and pose

Input: degrees or [degrees segments] | radius
Output: none

Creates an arc forward and to the left from the turtle's position, placing the turtle at its end. Arcs do not wrap across borders tidily in wrap mode. If the first parameter is specified as a list, the first value in the list is the degrees, the second is the number of segments in the arc to be created, which overrides the internal algorithm used to calculate the number of segments. See rightarc

leftarc 90 40

location

movement and pose

Input: co-ordinates (list)
Output: list

Returns a list of isRight, isAbove, isAhead where a value of 1 indicates the target co-ordinates are in those areas relative to the turtle's forward view, 0 indicates that the co-ordinates are on the same plane as the calling turtle as appropriate, and -1 indicates the co-ordinates are in the opposite region (eg a -1 for isRight indicates it is to the left of the turtle's forward vector / view).

snappy:show location myrtle:position
[0 0 1]
myrtle:show location snappy:position
[0 1 0]

lower

Also: lo

movement and pose

Input: turtle-units
Output: none

'Lowers' the turtle (moves back along its up vector). Same as doing 'down 90 forward turtle-units up 90'. For example, Myrtle in her home position when turtleSpaces is started will move away from the Snappy camera turtle if you lower her. See raise

lower 100

move

movement and pose

Input: distance (turtle-units) | degrees OR [degrees degrees] OR [[vector]]
Output: none

Moves the turtle in the specified direction the specified number of turtle-units without altering its orientation or vectors. If a list of two values is specified, moves both left-right (first value) and up-down (second value) in that order.

move 20 45
move 20 [45 45]
repeat 3600 [move repcount / 1000 repcount]

near

movement and pose

Input: position (list) | radius (number) OR [radius group] (list)
Output: list

Returns a list of all the turtles within the specified radius of turtle-units from the specified position. If a list is provided for the second parameter, only members of the specified group are returned. See nearme

show near [0 0 0] 10

nearme

movement and pose

Input: distance (number) OR [distance group] (list)
Output: turtles (list)

Returns a list of turtles within the specified distance of the calling turtle, except the calling turtle itself. If a list is provided, the first entry is distance, the second entry is the group – only members from this group are returned. See near, nearp

show nearme 200
show nearme [20 turtles]

noautoorbit

movement and pose

Input: none
Output: none

Turns off any existing autoorbit. See autoorbit.

noautoorbit

nostealth

movement and pose

Input: none
Output: none

Causes calling turtle to appear in lists generated by near. See stealth

stealth
nostealth
show near [0 0 0] 10

notether

movement and pose

Input: none
Output: none

Untethers the selected turtle from the orbit anchor point. When the turtle is untethered, the anchor point moves relative to it.

setanchor [0 0 0] notether
forward 50
show anchor

orbitdistance

movement and pose

Input: none
Output: turtle-units (number)

Returns the distance between a turtle and its anchor point. See setanchor, dropanchor

show orbitdistance

orbitdown

Also: odn

movement and pose

Input: degrees (number)
Output: none

Orbits down from (beneath) the turtle around its anchor point the specified number of degrees. Note that the turtle goes to its destination directly if fluid is off, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitdown 90

orbitleft

Also: olt

movement and pose

Input: degrees (number)
Output: none

Orbits the turtle left around its anchor point the specified number of degrees. Note that the turtle goes to its destination directly if fluid is off, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitleft 90

orbitright

Also: ort

movement and pose

Input: degrees (number)
Output: none

Orbits the turtle right around its anchor point the specified number of degrees. Note that the turtle goes to its destination directly if fluid is off, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

penup forward 60 dropanchor pullout 50 pendown
repeat 36 [orbitright 10]

orbitup

Also: oup

movement and pose

Input: degrees (number)
Output: none

Orbits up from (above) the turtle around its anchor point the specified number of degrees. Note that the turtle goes to its destination directly if fluid is disabled, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitup 90

orbitvector

movement and pose

Input: vector (list) | degrees (number)
Output: none

Orbits the specified number of degrees around the turtle's anchor point using the specified vector. To orbit in the opposite direction, specify a negative number of degrees. Note that the turtle goes to its destination directly regardless of the status of fluid, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitvector updir 10

orientation

movement and pose

Input: none
Output: list

Returns the current orientation, in the order specified by orientationorder. So if orientation order is set to "phr, then the first value returned by orientation will be pitch, the second heading and the third roll. See orientationorder

show orientation

orientationorder

movement and pose

Input: none
Output: word

Returns the current order heading, pitch and roll are processed when setorientation, setheading, setpitch or setroll is used.

show orientationorder
"hpr

origin

movement and pose

Input: none
Output: list

Returns the current origin co-ordinates. See setorigin, home

show origin
[0 0 0]

originvectors

movement and pose

Input: none
Output: list

Returns the current origin vectors. See setoriginvectors, origin, home

show originvectors

pitch

Also: pt

movement and pose

Input: none
Output: pitch (number)

Returns the pitch (attitude) of the current turtle

print pitch

pos

movement and pose

Input: none
Output: [x y] (list)

Returns the x and y co-ordinates of the turtle. For all three dimensions, use position

show pos

position

movement and pose

Input: none
Output: [x y z] (list)

Returns the co-ordinates of the turtle. For just the first two dimensions, use pos

show position

project

movement and pose

Input: [x% y% (Z)] (list)
Output: list

Returns a list containing the associated X and Y coordinates of the given percentage values as returned by mousex and mousey, assuming the given Z plane (or 0 if not provided). You can use this to set the turtle position to the mouse pointer position. This currently only works if the camera is in its home position. See mousex, mousey

show project [50 20]
setpos project {mousex mousey}

pullin

Also: pui

movement and pose

Input: turtle-spaces (number)
Output: none

Pulls the calling turtle toward its anchor point the specified number of turtle-spaces. Stops if it reaches its anchor point.

pullin 40

pullout

Also: puo

movement and pose

Input: turtle-spaces (number)
Output: none

Pulls the calling turtle out away from its anchor point the specified number of turtle-spaces.

dropanchor repeat 20 [penup pullout 10 pendown repeat 36 [orbitleft 10]]

raise

Also: ra

movement and pose

Input: turtle-units (number)
Output: none

Raises (elevates) the currently selected turtle by the specified number of turtle-units. Draws a line if the pen is down. See lower

raise 20

randomheading

Also: randhead

movement and pose

Input: none
Output: none

Sets the turtle to a random heading (direction)

repeat 12 [randomheading forward 40 back 40]

randomposition

Also: randpos

movement and pose

Input: none
Output: none

Places turtle in a random position in its current bounds on the current Z plane. See bounds

repeat 20 [penup randomposition pendown circle 5]

randomvectors

Also: randvec

movement and pose

Input: none
Output: none

Orients the currently selected turtle randomly in three dimensions. This does NOT alter the current pitch, heading or roll values.

pendown repeat 10 [randomvectors fd 100 home]

relative

movement and pose

Input: [x y z] (list)
Output: [heading pitch] (list)

Returns the relative heading and pitch adjustments, as a list, required to turn the calling turtle from its current orientation to face the provided 3D co-ordinate. Unlike towards, relative considers the full [x y z] position and the turtle's current view direction, so it works at any orientation. Applying the result as right first relative [x y z] followed by up second relative [x y z] will point the turtle at the target. The smaller (possibly negative) angle is always returned. See towards, setheading.

right first relative [30 40 50] up second relative [30 40 50]

right

Also: rt

movement and pose

Input: degrees
Output: none

Turns the selected turtle the specified number of degrees to the right. If the specified number of degrees is negative, turns it to the left. See left

right 90

rightarc

Also: rarc

movement and pose

Input: degrees or [degrees segments] | radius
Output: none

Creates an arc forward and to the right from the turtle's position, placing the turtle at its end. Arcs do not wrap accurately across borders in wrap mode. If a list is provided for the first parameter, the second item in the list specifies the number of segments to be used in the construction of the rarc. See leftarc

rightarc 90 40

rightdir

movement and pose

Input: none
Output: vector

Returns the right vector of the selected turtle. See leftdir

show rightdir

leftdir

movement and pose

Input: none
Output: vector

Returns the left vector of the selected turtle. See rightdir

show leftdir

roll

Also: ro

movement and pose

Input: none
Output: number

Returns the current roll value. See setroll

show roll

rollleft

Also: rl

movement and pose

Input: degrees (number)
Output: none

Rolls the currently selected turtle to the left by the provided number of degrees.

rollleft 90

rollright

Also: rr

movement and pose

Input: degrees (number)
Output: none

Rolls the currently selected turtle to the right by the provided number of degrees.

rollright 45

setanchor

movement and pose

Input: position (list) [X Y (Z)]
Output: none

Sets the selected turtle's orbit anchor to the specified two or three-dimensional position. Compare with fixate.

setanchor [50 20] ;no Z (implied 0)
setanchor [0 0 10] ;with Z

setbarriers

movement and pose

Input: [[[x1 y1 z1][x2 y2 z2]][[x3 y3 z3][x4 y4 z4]]…] (list of lists)
Output: none

Sets barriers on the calling turtle. The calling turtle cannot venture into the defined area(s). See barriers

setbarriers [[[0 0 0][100 100 100]]]

setbounds

Also: sbds

movement and pose

Input: x1 y1 x2 y2 (list) OR [[x1 y1 z1][x2 y2 z2]] (list of lists) OR radius
Output: none

Sets the boundary used by wrap and fence. If a single value is provided, the boundary is the radius of a circle / sphere, with the current origin value as its center. If a negative single value is provided, the boundary is a hemisphere laid on Z – that is, the turtle cannot travel into negative Z values. If no Z values are provided, sets them to -1000 / 1000. The default bounds are [[-212 -119 100] [212 119 100]] where [[x1 y1 z1] [x2 y2 z2]] making the default display area 424 turtle-units wide, 238 turtle-units high and 200 turtle units deep. See bounds, fence, wrap

setbounds [-100 -100 100 100]
setbounds [[-100 -100 -100][100 100 100]

setheading

Also: seth shd

movement and pose

Input: degrees (number)
Output: none

Sets the turtle's heading (left-right) and updates its orientation appropriately. Be aware that while setheading will alter the value of heading for the purposes of orientation, setorientation may not restore the expected turtle orientation if setheading is used in isolation. If you intend to use setorientation to restore a turtle's orientation, you should use setorientation to change aspects of a turtle's orientation also. See orientation

setheading 90

setorbitdistance

movement and pose

Input: turtle-units (number)
Output: none

Sets the currently selected turtle's distance from its anchor point.

setorbitdistance 100

setorientation

movement and pose

Input: vectors (list)
Output: none

First unwinds the current orientation in the reverse of orientationorder, then changes the calling turtle's orientation in the order specified by orientationorder, so that if orientationorder is "PHR then the first orientation changed is pitch, then heading, then the roll. Due to the nature of 3D movements, setorientation can only be used to restore orientations that are the result of relatively simple transforms (that is, series of orientation changing commands such as rollright or down). To restore complex orientations, use both setorientation and setvectors. See setvectors

setorientation [0 90 0]

setorientationorder

movement and pose

Input: order (word)
Output: none

Sets the order in which heading, pitch and roll are processed after using setheading, setpitch or setroll. The required word is a three letter combination made up of h, for heading, p, for pitch, and r, for roll. See orientationorder

setorientationorder "hpr
setorientationorder "rhp

setorigin

movement and pose

Input: [x y z] (list)
Output: none

Sets the turtle's origin, the location it goes when it goes home. See origin, home

setorigin [50 50 50]

setoriginvectors

movement and pose

Input: vectors (list)
Output: none

Sets the turtle’s origin vectors, the orientation the turtle ends up in when it goes home. See originvectors, vectors, home

setoriginvectors vectors

setpitch

Also: setp spi

movement and pose

Input: degrees (number)
Output: none

Sets the turtle's pitch (up-down) and updates its orientation appropriately. Be aware that while setpitch will alter the value of pitch for the purposes of orientation, setorientation may not restore the expected turtle orientation if setpitch is used in isolation. If you intend to use setorientation to restore a turtle's orientation, you should use setorientation to change aspects of a turtle's orientation also. See orientation

setpitch 180

setposition

Also: setpos spo

movement and pose

Input: [x y (z)] (list) OR [[x1 y1 z1] [x2 y2 z2]…]
Output: none

Sets the turtle's co-ordinates. If the pen is down, a line is drawn between the turtle's old position and its new position. If a list of lists is provided to setposition, it draws lines connecting those points (if pen down), leaving the turtle at the final position given.

setpos [20 30]
setposition [10 20 30]
pendown repeat 100 [setposition {-200 + random 400 -200 + random 400 -200 + random 400}]

setroll

Also: setr sro

movement and pose

Input: degrees (number)
Output: none

Sets the turtle's roll (rollleft-rollright) and updates its orientation appropriately. Be aware that while setroll will alter the value of roll for the purposes of orientation, setorientation may not restore the expected turtle orientation if setroll is used in isolation. If you intend to use setorientation to restore a turtle's orientation, you should use setorientation to change aspects of a turtle's orientation also. See orientation

setroll 90

setvectors

movement and pose

Input: [[forwarddir] [updir] [rightdir]] (list of lists)
Output: none

Sets the current turtle's orientation using vectors.

setvectors [1 -1 0] [1 1 1] [0 0 0]

setx

movement and pose

Input: number
Output: none

Sets the turtle's x position.

setx 100

setxy

movement and pose

Input: x (number) | y (number)
Output: none

Sets the turtle's x and y co-ordinates. This is here for compatibility. As opposed to setpos, which takes the two co-ordinates as a list. See setpos

setxy 10 20

sety

movement and pose

Input: number
Output: none

Sets the turtle's y position.

sety 20

setz

movement and pose

Input: number
Output: none

Sets the turtle's z position.

setz 50

showme

movement and pose

Input: turtle
Output: none

Causes the calling turtle to position itself in the default view turtle position over the specified turtle. Usually called by the current view (camera) turtle.

showme "myrtle

slideleft

Also: sl

movement and pose

Input: turtle-steps
Output: none

'Slides' the turtle to the left the given number of turtle-steps.

slideleft 20

slideright

Also: sr

movement and pose

Input: turtle-steps
Output: none

'Slides' the turtle to the right the given number of turtle-steps.

slideright 30

spin

movement and pose

Input: [vectors] (list) | degrees
Output: none

Spins the turtle around the given vector by the given number of degrees in a clockwise direction from behind the vector such that SPIN FORWARDDIR 90 would be the same as ROLLRIGHT 90. Does not affect pitch, heading or roll.

spin forwarddir 90

stealth

movement and pose

Input: none
Output: none

Causes the calling turtle not to appear in lists returned by near. See nostealth

stealth
show near [0 0 0] 10

tether

movement and pose

Input: none
Output: none

Tethers the selected turtle to the orbit anchor point. If the turtle moves, the anchor point remains unchanged. See setanchor, notether

setanchor [0 0 0] tether
forward 50
show anchor

topedge

movement and pose

Input: none
Output: number

Returns the top y co-ordinate for the bounds used by wrap and fence. See bottomedge, leftedge, rightedge, loweredge, upperedge

show topedge

bottomedge

movement and pose

Input: none
Output: number

Returns the bottom y co-ordinate for the bounds used by wrap and fence. See topedge, leftedge, rightedge, loweredge, upperedge

show bottomedge

leftedge

movement and pose

Input: none
Output: number

Returns the left x co-ordinate for the bounds used by wrap and fence. See topedge, bottomedge, rightedge, loweredge, upperedge

show leftedge

rightedge

movement and pose

Input: none
Output: number

Returns the right x co-ordinate for the bounds used by wrap and fence. See topedge, bottomedge, leftedge, loweredge, upperedge

show rightedge

loweredge

movement and pose

Input: none
Output: number

Returns the lower z co-ordinate for the bounds used by wrap and fence. See topedge, bottomedge, leftedge, rightedge, upperedge

show loweredge

upperedge

movement and pose

Input: none
Output: number

Returns the upper z co-ordinate for the bounds used by wrap and fence. See topedge, bottomedge, leftedge, rightedge, loweredge

show upperedge

towards

movement and pose

Input: [x y] (list)
Output: heading (number)

Returns a heading that would make the turtle face toward the provided co-ordinates. towards assumes the target co-ordinate is on the same Z plane as the turtle. towards is a legacy Apple Logo primitive that is useful in turtleSpaces for compatibility and two-dimensional applications. See heading

setheading towards [30 40]

up

movement and pose

Input: degrees
Output: none

Angles the 'nose' of the turtle up the specified number of degrees. If looking down at the turtle from above (the default view), up 90 will cause the turtle to point straight up towards you.

up 90

updir

movement and pose

Input: none
Output: vector (list)

Returns the calling turtle's current up vector. See downdir, rightdir, forwarddir

show updir

downdir

movement and pose

Input: none
Output: vector (list)

Returns the calling turtle's current down vector. See updir, rightdir, forwarddir

show downdir

unproject

movement and pose

Input: position (list)
Output: [x-percent y-percent (list)

Returns the 2D position of the object as a percentage of the window / screen. For example, if the turtle appears to be in the dead center of the screen, unproject will return 50% across and 50% down. Note: If the co-ordinate is not in the view of the camera, unproject will return spurious results!

unproject myrtle:position

vectors

movement and pose

Input: none
Output: [forwarddir updir rightdir]

Returns the orientation vectors of the turtle as a list. This is the most reliable method of storing and restoring the orientation of a turtle, as opposed to the orientation function, which returns relative heading / pitch / roll values.

print vectors

xpos

Also: xcor

movement and pose

Input: none
Output: xpos (number)

Returns the current x co-ordinate of the turtle.

show xpos

ypos

Also: ycor

movement and pose

Input: none
Output: ypos (number)

Returns the current y co-ordinate of the turtle.

show ypos

zpos

Also: zcor

movement and pose

Input: none
Output: zpos (number)

Returns the current z co-ordinate of the turtle.

show zpos

zeroheading

movement and pose

Input: none
Output: none

Zeroes the turtle's heading value. This does not modify the turtle's orientation. Further changes will modify heading as appropriate. This primitive allows you to establish a new base heading value to work forward from. See heading

right 90 zeroheading
show heading
right 30 show heading

zeroorientation

movement and pose

Input: none
Output: none

Zeroes the turtle's orientation values (pitch, heading, roll). This does not modify the turtle's actual orientation. Further changes will modify orientation values as appropriate. This primitive allows you to establish new base orientation values to work forward from. See orientation

zeroorientation

zeropitch

movement and pose

Input: none
Output: none

Zeroes the turtle's pitch value. This does not modify the turtle's orientation. Further changes will modify pitch as appropriate. This primitive allows you to establish a new base pitch value to work forward from. See pitch

up 45 zeropitch
show pitch

zeroroll

movement and pose

Input: none
Output: none

Zeroes the turtle's roll value. This does not modify the turtle's orientation. Further changes will modify roll as appropriate. This primitive allows you to establish a new base roll value to work forward from. See roll

rollright 60 zeroroll
show roll

zoom

movement and pose

Input: none
Output: number

Returns the turtle's 'zoom' value, which is relevant to its display when it is a view turtle. 100 (as in 100%) is the default value. See setzoom

show zoom

xcor

movement and pose

Input: none
Output: number

Short form of xpos. Returns the turtle's X coordinate.

print xcor

ycor

movement and pose

Input: none
Output: number

Short form of ypos. Returns the turtle's Y coordinate.

print ycor

zcor

movement and pose

Input: none
Output: number

Short form of zpos. Returns the turtle's Z coordinate.

print zcor

polar

movement and pose

Input: none
Output: list

Returns the turtle's current position in spherical polar coordinates as a list [azimuth elevation radius]. Azimuth is the horizontal angle around the Z-axis in degrees, elevation is the vertical angle from the XY plane in degrees, and radius is the distance from the origin.

setpolar [0 0 100]
show polar
[0 0 100]
setpolar [90 0 100]
show polar
[90 0 100]
setpolar [0 90 100]
show polar
[0 90 100]

setpolar

movement and pose

Input: [azimuth elevation (radius)]
Output: none

Sets the turtle's position using spherical polar coordinates. Azimuth is the horizontal angle in degrees, elevation is the vertical angle in degrees, and radius is the distance from origin. If radius is omitted, the turtle maintains its current distance from the origin while moving to the specified angles.

setpolar [0 0 100]
show polar
[0 0 100]
setpolar [90 0 100]
show polar
[90 0 100]
setpolar [180 45]
; keeps current radius, changes angles only