Sunday, October 7, 2007

HP-35s 3D and 2D vector unpack subroutines

Subroutines to unpack 3D and 2D vectors when need to work on individual components.

Stack Input/Output:
3D case: [[u0, u1, u2], Y, Z, T | L]-> X008 ->[u2, u1, u0, u0 | [u0, u1, u2]]

2D case: [[u0, u1], Y, Z, T | L]-> X018 ->[u1, u0, Y, Y | [u0, u1]]
Program:
XOO8 [1,0,0]
X009 X<>Y
X010 x
X011 [0,1,0]
X012 LASTX
X013 x
X014 [0,0,1]
X015 LASTX
X016 x
X017 RTN
X018 [1,0]
X019 X<>Y
X020 x
X021 [0,1]
X022 LASTX
X023 x
X024 RTN
Comments:

Terms of use.

Uses the X label for vector utility programs/routines, from before have cross product and normalization.

No comments: