DISTANCEXYZ

Synopsis
DISTANCEXYZ position
Description

Outputs a number, the distance the turtle must travel along a straight line to reach a 3D coordinate. The position input must be a three item list containing the position's X, Y, and Z coordinates.

DISTANCEXYZ is designed to run in PERSPECTIVE mode. In 2D modes, DISTANCEXYZ ignores the Z-axis and outputs the straight-line distance between the turtle and the given X and Y coordinates.

Example
PERSPECTIVE
SETPOSXYZ [0 0 0]
SHOW DISTANCEXYZ [0 100 0]
100
SHOW DISTANCEXYZ [100 100 100]
173.205080756888
PERSPECTIVE
SETORIENTATION TOWARDSXYZ [300 400 500]
FORWARD DISTANCEXYZ [300 400 500]

SourceForge.net Logo