The Museum of HP Calculators

HP Forum Archive 18

[ Return to Index | Top of Index ]

HP-35S and angle between two segments in the space
Message #1 Posted by Antonio Maschio (Italy) on 24 Apr 2008, 11:07 a.m.

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

      
Re: HP-35S and angle between two segments in the space
Message #2 Posted by Howard Boardman on 24 Apr 2008, 3:58 p.m.,
in response to message #1 by Antonio Maschio (Italy)

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.

      
Re: HP-35S and angle between two segments in the space
Message #3 Posted by Chuck on 24 Apr 2008, 4:51 p.m.,
in response to message #1 by Antonio Maschio (Italy)

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

            
Re: HP-35S and angle between two segments in the space
Message #4 Posted by Mark Storkamp on 24 Apr 2008, 5:16 p.m.,
in response to message #3 by Chuck

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.

                  
Re: HP-35S and angle between two segments in the space
Message #5 Posted by marais on 24 Apr 2008, 5:36 p.m.,
in response to message #4 by Mark Storkamp

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.

                  
Re: HP-35S and angle between two segments in the space
Message #6 Posted by Chuck on 24 Apr 2008, 5:40 p.m.,
in response to message #4 by Mark Storkamp

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

      
Re: HP-35S and angle between two segments in the space
Message #7 Posted by Antonio Maschio (Italy) on 26 Apr 2008, 6:52 a.m.,
in response to message #1 by Antonio Maschio (Italy)

Thanks to anyone.

-- Antonio


[ Return to Index | Top of Index ]

Go back to the main exhibit hall