Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Geometry/Vector 3

Status
Not open for further replies.

dik

Structural
Apr 13, 2001
26,059
I have three points in 3D space, P1, P2 and P3, defined by (x1, y1, z1), (x2, y2, z2) and (x3, y3, z3). Does anyone have a formula that calculates the angle between lines P1,P2 and P2, P3 and the angle of the plane, going through the points, relative to the x-y plane?

Thanks, Dik
 
Replies continue below

Recommended for you

The angle between two vectors in space is given by the relationship
cos theta = (u.v)/((abs u)*(abs v))
The numerator is the dot product of the vectors which is a scalar quantity, not a vector and is given by u1*v1 + u2*v2 + u3*v3
The denominator is the product of the absolute values of the magnitudes of the vector which are given by (individually) ((x^2)+(y^2)*(z^2))^0.5
 
Good memory, StrEIT..

I was racking my brain here because I knew I had used that before, but I didn't have any of my calc notes in the office.
 
I guess I should say that u is the first vector, line P1,P2 in your case, and would be shown as (x2-x1, y2-y1, z2-z1)- assuming that P1 is the starting point. v is the second vector, line P2, P3 in your case and is (x3-x2, y3-y2, z3-z2)- assuming that P2 is your starting point.
 
We'll give it a try... thanks, Dik
 
if you post the coordinates, I'll see if my answer matches yours.
 
I believe there is a typo in your last expression where ... (y^2)+(z^2))^0.5
Reading the question, I suspect dik wants P2 to be the starting point for both vectors. This is not trivial because if you pick the wrong direction of the vectors, you could end up computing the supplemental angle (the angle necessary to obtain 180 degrees when aded to the original angle) rather than the angle of interest. I remember doing some COGO stuff some time ago and it was very important to keep your points in the right order.

As for getting the angle between the vector plane and the x-y plane, I think the first step would be to compute the cross product of the two vectors, which I believe creates an orthogonal vector to the vector plane. Reduce this to a unity vector and then I think you will have the direction cosines necesary to get the angle you want.

I might check my CRC Math handbook. I think the answer is very simple with the direction cosines.
 
I believe you may be right in what dik is looking for, but I did qualify my expression by saying, "assuming the starting point is P1 (or P2)".
Also, that would relate to the expression in my second post, not the last one that you reference in my first post. The magnitude of the vector is the same regardless of the direction.
 
Thinking on the solution further, since the third direction cosine is the cosine of the angle between the Z-axis and the vector, the angle between the X-Y plane and the vector is 90 degrees - acos(w), where 'w' is the direction cosine for the Z term in the unit vector.

Mag x ( u x i + v x j + w x k ) = vector cross product of (U,V)

A little old fashioned, but I believe it is the correct forumla.
 
I was thinking that if this gives the angle between the vectors, then if I add the two vectors to get a third vector and arbitrarily set the z component of this equal to zero to create a fourth vector.

If I use the method above to determine the angle between vectors 3 and 4, then this should be the angle to the x-y plane. Correct in my thinking?

Dik
 
Let's go back as S-EIT did, and label our values so we can be sure what we are discussing.

The Vector from P2 to P1 is U (capitol denotes vector quantity)
The Vector from P2 to P3 is V
The angle between these two vectors may be determined from the relationship ...
U.V = u x v x cos (theta)
e.g. the dot product of U and V is equal to the magnitude of vector U (denoted 'u') times the magnitude of vector V (denoted 'v') times the cosine of the angle between the two vectors (denoted 'theta').

Adding the two vectors together, U+V=H, will only give you a new vector (denoted 'H') that "closes the triangle."

If you need the angle of the plane formed by points P1, P2 & P3 to plane X-Y, then you will need to take a step to compute the orientation of this P123 plane. As it turns out, the cross product of two vectors yields a new vector that is perpendicular to the plane P123. The angle between this plane, P123, and the X-Y plane is the acos of the third direction cosine in the cross product.

Vector W = U x V (Vector U cross Vector V)

This vector W is perpendicular to the plane P123. The magnitude of vector W is denoted 'w'. If the direction cosines of vector W are denoted by (a x i + b x j + c x k) then Vector W may be expressed as w x (a x i + b x j + c x k). The angle between plane P123 and the X-Y plane is then equal to the acos(c). This is not the same answer I gave earlier. The answer I gave earlier was wrong. It would have given you the complementary angle.

As with many problems in math, there are surely other methods to get the answer, but this is the most direct I can think of.
 
Dino... Vector H will be a new vector that will be the resultant force of vector U and V. This is the force I'm looking for. Point P2 is datum, ie (x, y z) are all 0,0,0 so when I have Vector H, it should start at (0, 0, 0) and the end point should be (x1+x2, y1+y2, z1+z2).

If I determine the angle between this and (x1+x2, y1+y2, 0) usig the method described by StructuralEIT, this should be the angle of the vector from the x-y plane. Is this not correct?

I'll try using a spreadsheet and see what pops up...

Dik
 
It works... thanks to all...

Force of 68K in direction of two vectors. Fy = 16.721K, Fz = 0.701K, Angle between the forces 165.876 degrees, and angle from plane = 2.40 degrees. This is supplement to 177.60 degrees calculated by method from StructuralEIT.

Spreadsheet attached...

Thanks, Dik
 
 http://files.engineering.com/getfile.aspx?folder=733b9bbb-7670-4d50-8c11-11d2d82cf00b&file=VECTORS.xls
Let {u} be the unit vector from P2 to P1.
Let {v} be the unit vector from P2 to P3.

Then the vector angle that Dik wants is
[{u}cross{v}]/[{u}dot{v}]
The magnitude of this vector is the magnitude of the angle, and its direction is that of the normal to the plane defined by P1, P2 & P3.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor