Monday, October 15, 2007

HP-35s 2D to 3D vector conversion

Short program to convert a 2D vector to a 3D by placing it in the z=0 plane. Usefull when want to utilize 3D solutions to 2D data, for example taking cross product of two 2D vectors.

Stack Input/Output:
[[u, v], Y, Z, T | L]-> XEQ 068 ->[[u, v, 0], Y, Z, T | [u, v]]
Program:
X068 ABS
X069 RDN
X070 eq [[1,0]xLASTX,[0,1]xLASTX,0]
X071 RTN
Comments:

Terms of use.

Placed in the X 'library' since a vector utlity, from before have projecting to a cardinal plane, finding the component of a 3D vector with max absolute value, vector unpack routines, cross product and normalization.

No comments: