[Math] Angle between Two Lines in 3D Space

geometry

Since my two lines are orthogonal (one in y-z plane and one in y-x), I KNOW there's a (probably simple) formula for the calculation I need, but somehow I haven't been able to find it. Equations of the two lines

y = .384z (or, 22.6 degrees)

y = -3.864x (or -75 degrees)

Obviously, they intersect at the origin. I want the angle as measured in the plane defined by these two lines.

Best Answer

Take a point $A$ on the first line and a point $B$ on the second line. For instance: $$ A=(0,0.384,1);\quad B=(1,-0.3864,0). $$ To find the angle $\theta=\angle AOB$ between lines, you can choose among several different ways. If you are comfortable with the cosine rule, you can for instance apply it to triangle $ABO$ (where $O=(0,0,0)$): $$ AB^2=OA^2+OB^2-2OA\cdot OB\cos\theta $$ and solve for $\cos\theta$.

Or you may exploit the definition of dot product: $$ \vec{OA}\cdot\vec{OB}=OA\cdot OB\cos\theta. $$