Since the program P stores N in variable N and d in variable O the following short program computes the closest point on the plane entered using program P if the point's positional vector is in the X stack register (problem 11 in the requirements).

Stack Input/Output:

[[x, y, z], Y, Z, T | L]-> XEQ Q ->[[cx, cy, cz], [x, y, z], Y, Z | L]Where (x, y, z) is point p and (cx, cy, cz) is closest point in plane to p.

Variables:

Reads:

N : Plane's normalized normal vector. Populated by the P program.Program:

O : Plane's distance to origo (0, 0, 0). Populated by the P program.

Q001 LBL QComments:

Q002 eq REGX-(REGXxN+O)xN

Q003 RTN

Terms of use.

Mnemonic: Sorry, run out :-(

Unless the input is a point in the plane (if this is the case the vectors in Y and X stack register are the same after execution) the line defined by the point in Y stack register and the point in X stack register defines the perpendicular line from point now in the Y stack register onto the plane entered using the program P. May be used as input to the L program or M program.

## No comments:

Post a Comment