リファレンス › Movement and Pose — 110 個のコマンド


anchor

movement and pose

入力: none
出力: 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

入力: position (list) | vector (list) | length (number) | radius (number)
出力: 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

入力: direction (word) | degrees (number) | time (60ths of a second)
出力: 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

別名: bk

movement and pose

入力: turtlesteps (number)
出力: none

現在のタートルを指定されたタートルステップ数だけ後退させます。

back 20

barriers

movement and pose

入力: none
出力: list

Lists the existing barriers. See setbarriers

show barriers

direction

movement and pose

入力: position (list)
出力: 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

入力: position (list) | position (list)
出力: distance (number)

1 つ目の座標から 2 つ目の座標までの距離を返します。distance は [X Y Z] のリストでも、Z を 0 とみなす [X Y] のリストでも使えます。

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

divergence

movement and pose

入力: [vector1 vector2] (list) | [vector3 vector4] (list)
出力: 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

別名: dn

movement and pose

入力: degrees (number)
出力: none

呼び出したタートルの鼻先を指定された角度だけ下に向けます。up を参照

down 45

drift

movement and pose

入力: steps vector
出力: 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

入力: none
出力: 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

入力: position (list) | vectors (list) | [left right forward backward above below] (list)
出力: 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

入力: position (list) | vector (list) | distance (number)
出力: 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

入力: position (list of 3) | position (list of 3)
出力: 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

入力: co-ordinates (list) | degrees (number)
出力: 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

入力: none
出力: none

setbounds で設定された画面の境界に達した場合、呼び出したタートルを停止させます。setbounds, bounds, window, wrap, hitboundsp を参照

fence

fixate

別名: fix

movement and pose

入力: position
出力: 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

別名: fd

movement and pose

入力: turtle-spaces (number)
出力: none

タートルを指定されたタートルステップ数だけ前進させます。ペンが下りている場合は線を描きます。pendown, back を参照

forward 20

forwarddir

movement and pose

入力: none
出力: vector (list)

Returns the calling turtle's forward vector. See backdir

show forwarddir

backdir

movement and pose

入力: none
出力: vector (list)

Returns the calling turtle's back vector. See forwarddir

show backdir

heading

別名: hd

movement and pose

入力: none
出力: degrees

選択中のタートルの方位(x 軸)を度で返します。heading は相対的な累積値であり、タートルが三次元で動く場合、これだけで向きを正確に再現することはできません。そのためには orientation / setorientation を使ってください。pitch と roll を参照

print heading

home

movement and pose

入力: none
出力: none

現在選択されているタートルをホーム位置に戻します。

home

inside

movement and pose

入力: [[x1 y1 z1] [x2 y2 z2]]
出力: 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

入力: steps (number)
出力: none

ペンの状態にかかわらず、描画せずにタートルを指定されたタートルステップ数だけ前進させます。

jump 20

left

別名: lt

movement and pose

入力: degrees
出力: none

選択中のタートルを指定された角度だけ左に回転させます。right を参照

left 90
lt 45

leftarc

別名: larc

movement and pose

入力: degrees or [degrees segments] | radius
出力: none

タートルの位置から前方かつ左向きに弧を作成し、タートルをその終点に配置します。弧は wrap モードで境界をきれいにまたぎません。第 1 引数をリストで指定した場合、1 つ目の値が角度、2 つ目が弧を構成するセグメント数で、セグメント数の計算に使われる内部アルゴリズムを上書きします。rightarc を参照

leftarc 90 40

location

movement and pose

入力: co-ordinates (list)
出力: 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

別名: lo

movement and pose

入力: turtle-units
出力: none

タートルを下げます(上方向ベクトルに沿って後退させます)。down 90 forward turtle-units up 90 と同じです。たとえば turtleSpaces の起動時にホーム位置にいる Myrtle を lower すると、カメラタートルの Snappy から遠ざかります。raise を参照

lower 100

move

movement and pose

入力: distance (turtle-units) | degrees OR [degrees degrees] OR [[vector]]
出力: none

タートルの向きやベクトルを変えずに、指定された方向へ指定されたタートル単位数だけ移動させます。2 つの値のリストを指定した場合は、左右(1 つ目の値)と上下(2 つ目の値)の順に移動します。

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

near

movement and pose

入力: position (list) | radius (number) OR [radius group] (list)
出力: 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

入力: distance (number) OR [distance group] (list)
出力: 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

入力: none
出力: none

Turns off any existing autoorbit. See autoorbit.

noautoorbit

nostealth

movement and pose

入力: none
出力: none

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

nostealth

notether

movement and pose

入力: none
出力: none

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

notether

orbitdistance

movement and pose

入力: none
出力: turtle-units (number)

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

show orbitdistance

orbitdown

別名: odn

movement and pose

入力: degrees (number)
出力: none

タートルの下方からアンカーポイントの周りに、指定された角度だけ周回させます。fluid が無効な場合、タートルは目的地へ直接移動し、ペンが下りていれば始点と目的地の間に中間点のない線が描かれます。setanchor, dropanchor を参照

orbitdown 90

orbitleft

別名: olt

movement and pose

入力: degrees (number)
出力: none

タートルをアンカーポイントの周りに、指定された角度だけ左に周回させます。fluid が無効な場合、タートルは目的地へ直接移動し、ペンが下りていれば始点と目的地の間に中間点のない線が描かれます。setanchor, dropanchor を参照

orbitleft 90

orbitright

別名: ort

movement and pose

入力: degrees (number)
出力: none

タートルをアンカーポイントの周りに、指定された角度だけ右に周回させます。fluid が無効な場合、タートルは目的地へ直接移動し、ペンが下りていれば始点と目的地の間に中間点のない線が描かれます。setanchor, dropanchor を参照


orbitup

別名: oup

movement and pose

入力: degrees (number)
出力: none

タートルの上方からアンカーポイントの周りに、指定された角度だけ周回させます。fluid が無効な場合、タートルは目的地へ直接移動し、ペンが下りていれば始点と目的地の間に中間点のない線が描かれます。setanchor, dropanchor を参照

orbitup 90

orbitvector

movement and pose

入力: vector (list) | degrees (number)
出力: 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

入力: none
出力: 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

入力: none
出力: 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

入力: none
出力: list

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

show origin
[0 0 0]

originvectors

movement and pose

入力: none
出力: list

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

show originvectors

pitch

別名: pt

movement and pose

入力: none
出力: pitch (number)

現在のタートルのピッチ(仰角)を返します。

print pitch

pos

movement and pose

入力: none
出力: [x y] (list)

タートルの x 座標と y 座標を返します。3 次元すべてが必要な場合は position を参照

show pos

position

movement and pose

入力: none
出力: [x y z] (list)

タートルの座標を返します。最初の 2 次元だけが必要な場合は pos を参照

show position

project

movement and pose

入力: [x% y% (Z)] (list)
出力: 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

別名: pui

movement and pose

入力: turtle-spaces (number)
出力: none

呼び出したタートルを、アンカーポイントに向かって指定されたタートルスペース数だけ引き寄せます。アンカーポイントに到達すると停止します。

pullin 40

pullout

別名: puo

movement and pose

入力: turtle-spaces (number)
出力: none

呼び出したタートルを、アンカーポイントから指定されたタートルスペース数だけ引き離します。

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

raise

別名: ra

movement and pose

入力: turtle-units (number)
出力: none

現在選択されているタートルを、指定されたタートル単位数だけ上昇させます。ペンが下りている場合は線を描きます。lower を参照

raise 20

randomheading

別名: randhead

movement and pose

入力: none
出力: none

タートルをランダムな方位(向き)に設定します。

randomheading

randomposition

別名: randpos

movement and pose

入力: none
出力: none

現在の Z 平面上で、現在の境界内のランダムな位置にタートルを配置します。bounds を参照

randomposition

randomvectors

別名: randvec

movement and pose

入力: none
出力: 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

入力: [x y z] (list)
出力: [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

別名: rt

movement and pose

入力: degrees
出力: none

選択中のタートルを指定された角度だけ右に回転させます。負の角度を指定した場合は左に回転します。left を参照

right 90

rightarc

別名: rarc

movement and pose

入力: degrees or [degrees segments] | radius
出力: none

タートルの位置から前方かつ右向きに弧を作成し、タートルをその終点に配置します。弧は wrap モードで境界を正確にまたぎません。第 1 引数をリストで指定した場合、リストの 2 つ目の要素が rarc の構成に使われるセグメント数を指定します。leftarc を参照

rightarc 90 40

rightdir

movement and pose

入力: none
出力: vector

Returns the right vector of the selected turtle. See leftdir

show rightdir

leftdir

movement and pose

入力: none
出力: vector

Returns the left vector of the selected turtle. See rightdir

show leftdir

roll

別名: ro

movement and pose

入力: none
出力: number

現在のロール値を返します。setroll を参照

show roll

rollleft

別名: rl

movement and pose

入力: degrees (number)
出力: none

現在選択されているタートルを、指定された角度だけ左にロールさせます。

rollleft 90

rollright

別名: rr

movement and pose

入力: degrees (number)
出力: none

現在選択されているタートルを、指定された角度だけ右にロールさせます。

rollright 45

setanchor

movement and pose

入力: position (list) [X Y (Z)]
出力: 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

入力: [[[x1 y1 z1][x2 y2 z2]][[x3 y3 z3][x4 y4 z4]]…] (list of lists)
出力: 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

別名: sbds

movement and pose

入力: x1 y1 x2 y2 (list) OR [[x1 y1 z1][x2 y2 z2]] (list of lists) OR radius
出力: none

wrap と fence が使用する境界を設定します。値を 1 つだけ指定した場合、境界は現在の origin を中心とする円/球の半径になります。負の値を 1 つ指定した場合、境界は Z 上に置かれた半球になります。つまりタートルは負の Z 方向へ進めません。Z の値を指定しない場合は -1000 / 1000 に設定されます。既定の境界は [[-212 -119 100] [212 119 100]] で、[[x1 y1 z1] [x2 y2 z2]] の形式です。これにより既定の表示領域は幅 424、高さ 238、奥行き 200 タートル単位になります。bounds, fence, wrap を参照

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

setheading

別名: seth shd

movement and pose

入力: degrees (number)
出力: none

タートルの方位(左右)を設定し、それに応じて向きを更新します。setheading は orientation のための heading の値を変更しますが、setheading を単独で使った場合、setorientation が期待どおりの向きを復元できないことがあります。setorientation で向きを復元するつもりなら、向きの変更にも setorientation を使ってください。orientation を参照

setheading 90

setorbitdistance

movement and pose

入力: turtle-units (number)
出力: none

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

setorbitdistance 100

setorientation

movement and pose

入力: vectors (list)
出力: 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

入力: order (word)
出力: 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

入力: [x y z] (list)
出力: 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

入力: vectors (list)
出力: 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

別名: setp spi

movement and pose

入力: degrees (number)
出力: 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

別名: setpos spo

movement and pose

入力: [x y (z)] (list) OR [[x1 y1 z1] [x2 y2 z2]…]
出力: none

タートルの座標を設定します。ペンが下りている場合、タートルの元の位置と新しい位置の間に線が描かれます。setposition にリストのリストを与えると、それらの点を結ぶ線が描かれ(ペンが下りている場合)、タートルは最後に与えられた位置に残ります。

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

setroll

別名: setr sro

movement and pose

入力: degrees (number)
出力: 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

入力: [[forwarddir] [updir] [rightdir]] (list of lists)
出力: none

現在のタートルの向きをベクトルで設定します。

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

setx

movement and pose

入力: number
出力: none

タートルの x 座標を設定します。

setx 100

setxy

movement and pose

入力: x (number) | y (number)
出力: 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

入力: number
出力: none

タートルの y 座標を設定します。

sety 20

setz

movement and pose

入力: number
出力: none

タートルの z 座標を設定します。

setz 50

showme

movement and pose

入力: turtle
出力: 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

別名: sl

movement and pose

入力: turtle-steps
出力: none

タートルを指定されたタートルステップ数だけ左に平行移動させます。

slideleft 20

slideright

別名: sr

movement and pose

入力: turtle-steps
出力: none

タートルを指定されたタートルステップ数だけ右に平行移動させます。

slideright 30

spin

movement and pose

入力: [vectors] (list) | degrees
出力: none

指定されたベクトルを軸として、そのベクトルの後方から見て時計回りに、指定された角度だけタートルを回転させます。したがって SPIN FORWARDDIR 90 は ROLLRIGHT 90 と同じです。ピッチ、方位、ロールの値には影響しません。

spin forwarddir 90

stealth

movement and pose

入力: none
出力: none

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

stealth

tether

movement and pose

入力: none
出力: none

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

tether

topedge

movement and pose

入力: none
出力: 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

入力: none
出力: 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

入力: none
出力: 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

入力: none
出力: 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

入力: none
出力: 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

入力: none
出力: 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

入力: [x y] (list)
出力: heading (number)

タートルが指定された座標の方を向くような方位を返します。towards は対象の座標がタートルと同じ Z 平面上にあると仮定します。towards は Apple Logo 由来のプリミティブで、互換性のためと二次元の用途で turtleSpaces でも有用です。heading を参照

setheading towards [30 40]

up

movement and pose

入力: degrees
出力: none

タートルの鼻先を指定された角度だけ上に向けます。既定の視点である真上から見下ろしている場合、up 90 でタートルはあなたの方へまっすぐ向きます。

up 90

updir

movement and pose

入力: none
出力: vector (list)

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

show updir

downdir

movement and pose

入力: none
出力: vector (list)

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

show downdir

unproject

movement and pose

入力: position (list)
出力: [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

入力: none
出力: [forwarddir updir rightdir]

タートルの向きベクトルをリストとして返します。相対的な heading / pitch / roll の値を返す orientation 関数に比べ、これはタートルの向きを保存・復元する最も確実な方法です。

print vectors

xpos

別名: xcor

movement and pose

入力: none
出力: xpos (number)

タートルの現在の x 座標を返します。

show xpos

ypos

別名: ycor

movement and pose

入力: none
出力: ypos (number)

タートルの現在の y 座標を返します。

show ypos

zpos

別名: zcor

movement and pose

入力: none
出力: zpos (number)

タートルの現在の z 座標を返します。

show zpos

zeroheading

movement and pose

入力: none
出力: none

タートルの heading の値をゼロにします。これはタートルの実際の向きを変えません。以降の変更は heading に適切に反映されます。このプリミティブにより、新しい基準方位を定めてそこから作業を進められます。heading を参照

zeroheading

zeroorientation

movement and pose

入力: none
出力: 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

入力: none
出力: 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

zeropitch

zeroroll

movement and pose

入力: none
出力: 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

zeroroll

zoom

movement and pose

入力: none
出力: 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

入力: none
出力: number

xpos の短縮形。タートルの X 座標を返します。

print xcor

ycor

movement and pose

入力: none
出力: number

ypos の短縮形。タートルの Y 座標を返します。

print ycor

zcor

movement and pose

入力: none
出力: number

zpos の短縮形。タートルの Z 座標を返します。

print zcor

polar

movement and pose

入力: none
出力: 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

入力: [azimuth elevation (radius)]
出力: 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