HP Forums
41-MCODE Vector Calculator (3D) - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: 41-MCODE Vector Calculator (3D) (/thread-205013.html)

41-MCODE Vector Calculator (3D) - Ángel Martin - 11-16-2011

I've taken the opportunity to add some extensions to the ROMS containing some of the HP_Solution_Books. In particular the Geometry ROM had more than 2/3rds. of empty space, a waste that needed correction - So I added a few triangle solvers and a coordinate tranformations FOCAL programs.

As there was still more available room, I went ahead and wrote a handy set of MCODE functions to handle 3D-Vector operations - you know, the usual suspects. They use the stack for the first operand and Alpha for the second, leaving the results in the stack - so nothing fancy like a Vector-stack or similar, just plain and simple.

A couple of interesting remakrs :

- V<>, VVIEW, VRCL and VSTO are programmable prompting functions that work on three-register blocks at once

- VVIEW and VIEWV sequentially display the three vector components using the display (not Alpha obviously)

- using the new functions the "VC" program from the HP-41 Advantage module shrinks down to barely 45 lines ;-)

The functions are listed below:- you can download it from TOS, just use the usual procedure.

-VECTORS	Header Section
A+V Vector Addition
A-V Vector Subtraction
A*V Vector Dot Product
AXV Vector Cross Product
V<> _ _ Vector Exchange
V<>A Vector Swap
VADST Distance between Vectors
VANG Angle Between Vectors
VCHS Vector negative
VIEWV Vector View
VINV Vector Inverse
VMOD Vector Magnitude
VNORM Vector Norm
VRCL _ _ RCL Vector
VSTO _ _ STO Vector
VUNIT Unit Vector
VVIEW _ _ View Vector