15

Mathematics Programs

Vector Operations

This program performs the basic vector operations of addition, subtraction, cross product, and dot (or scalar) product. The program uses three–dimensional vectors and provides input and output in rectangular or polar form. Angles between vectors can also be found.

Z

P

R

Y

T

X

This program uses the following equations. Coordinate conversion:

X= R sin(P) cos(T)

Y= R sin(P) sin(T)

R = X 2 + Y 2 + Z 2

T= arctan (Y/X)

Z

Z = R cos(P)

P = arctan

X 2

+ Y 2

 

 

Mathematics Programs 15–1