Angles of a line to axis to angle to planes

662 Views Asked by At

Considering a line in 3d defined by:

{a0, a1, a2} + t{m0,m1, m2}, t value in a seted range.

I can get angle made by the line to each axis, but I'm struggling to understand how to obtain the angle to (XY), (XZ), (YZ).

example:

line: [-1.44, 6.28, -0.60] + t [0.99, 0.008, -0.018], t in [-21; 21].

That gives me angles to axis (Z upward) in degrees:

xD: 1.13

yD: 89.53

zD: 91.03

And, considering rounding errors, those angles seems possible as they satisfy:

cos^2(xD)+cos^2(yD)+cos^2(zD) = 1

And that's pretty much all I'm sure of.

I've few math knowledge but here is what I thought:

xD is the angle between line & (0XZ)

yD is the angle between line & (0XY)

zD is the angle between line & (0ZY)

giving in my example:

xD at 1.1 degrees, thus making the line nearly parallel to the plan (OXZ).

yD at 89 degrees, thus making the line nearly normal to the plan (OXY).

zD at 91 degrees, thus making the line nearly normal to the plan (OZY).

which isn't possible...

Im obviously wrong.

How can I determine the line angles to those plans?

So it seems that the goal is to get the angle between the normal vector of plans and the line; but it makes no sense to me as

Normal vector to (XOZ): {0,1,0}.

A line following that vector is {0,0,0}+t{0,1,0} t in R.

P the angle:

cos(P) = Sn . Sl / |Sn| . |Sl|

with:

Sn = 0 i + 1 j + 0 k & |Sn| = 1

Sl = a i + b j + c k & |Sl| = sqrt(a^2 + b^2 + c^2)

Sl . Sn = b

then: cos(P) = Sn . Sl / |Sl| = b/|Sl|

Which is the equation of the angle made by the line to the Y-axis, i.e. my previous yD.

So it means that the angle is actually (in degrees) yD' = yD - 90 ?

That will make my example as:

xD at 1.1 degrees -> -88, thus making the line nearly normal to the plan (OXZ).

yD at 89 degrees -> -1, thus making the line nearly parallel to the plan (OXY).

zD at 91 degrees -> 1, thus making the line nearly parallel to the plan (OZY).

Am I right this time? that still seems odd.

1

There are 1 best solutions below

4
On BEST ANSWER

The angle between the $z$ axis and the $x,y$ plane is $90$ degrees.

If you look at any line that intersects the $x,y$ plane, you can put another line, parallel to the $z$ axis, through the point of intersection, and the result looks like this when viewed from an appropriate point in the $x,y$ plane far from the point of intersection:

enter image description here

The angles marked $A$ and $B$ add up to $90$ degrees. (The "arbitrary line" is obviously not the same as the line in the question; the angles of that line are too close to $0$ or $90$ degrees to make an easy-to-see picture, so I chose one that is easier to draw.)

Exactly what angles you will see will depend on where in the $x,y$ plane you are looking from; but if you position your viewing point so that the angle $A$ is as large as you can make it, the angle $A$ will be what you would call $z_D$ for this line, and the angle $B$ will be the angle between the line and the $x,y$ plane.

So the formula is $A + B = 90,$ or $B = 90 - A.$

You can make similar figures for lines parallel to the $x$ and $y$ axes, but in every case, notice that the arbitrary line makes an angle between one axis and the plane containing the other two axes. So if $A = z_D$ then $B$ is an angle with the $x,y$ plane; if $A = x_D$ then $B$ is an angle with the $y,z$ plane; if $A = y_D$ then $B$ is an angle with the $x,z$ plane.

If you rotate the arbitrary line in the figure you can make the angle $A$ greater than $90$ degrees, but the formula $B=90-A$ is still good; the result is negative, indicating that the angle $B$ is on the other side of the $x,y$ plane, opposite the positive $z$ direction.

So for your line we get these results:

$x_D = 1.13$ degrees, so the angle with the $y,z$ plane is $90 - 1.13 = 88.87$ degrees.

$y_D = 89.53$ degrees, so the angle with the $x,z$ plane is $90 - 89.53 = 0.47$ degrees.

$z_D = 91.03$ degrees, so the angle with the $x,y$ plane is $90 - 91.03 = -1.03$ degrees.