HP Forums

Full Version: HP-35S and angle between two segments in the space
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hi,

I have three points in the space, X, Y, Z, each identified with three space coordinates.

X(x1,y1,z1)
Y(x2,y2,z2)
Z(x3,y3,z3)
Now I have two segments, one from X1 to X2, the other from X2 to X3.

How can I quickly get the angle between these segments with my HP-35S and the vectors capabilities?

Thanks in advance to anyone answering.

-- Antonio

Not sure about vector operations but the easiest way to me seems to be calculating the distance between the points.. giving you a triangle with known side lengths. Then you can calculate internal angles with the law of cosines. This could easily be written into a program.

There are a number of ways, but here is one that uses the equation feature and the dot product.

Store points X1, X2, and X3, into A, B, and C.

In EQN , create:

ACOS((A-B)*(C-B)/(ABS(A-B)*ABS(C-B)))

and evaluate the EQN.

[EDIT] Be careful with the order the points are entered. My equation makes two vectors B to A, and B to C, or the angle ABC.

CHUCK


Edited: 24 Apr 2008, 5:43 p.m. after one or more responses were posted

Quote:

In EQN , create:

ACOS((A-B)*(C-B)/(ABS(A-B)*ABS(C-B)))

and evaluate the EQN.


Although that generally should work, the following is from the HP-35S Manual:

Dot Product
Function DOT is used to calculate the dot product of two vectors with the same
length. Attempting to calculate the dot product of two vectors of different length
causes an error message “Invalid Data”.

So it might be better to divide each vector by it's absolute value before using the dot product just to be safe.

Well, if this is so, the HP35 implementation of the dot product is wrong. My 28C does things as it should. The mathematical definition of the dot product limits it by no means to two normalized vectors.

A.

Invalid Data is when multiplying vectors [1,2,3] and [4,5], which of course can't be done. "Length" in the manual refers to "number of components", not the Norm of the vector (or at least I assumed this.)

CHUCK

Thanks to anyone.

-- Antonio