# Thread: Calculate angle between lines projected on a plane

1. ## Calculate angle between lines projected on a plane

Hello All

This may be an easy answer, but I've been racking my brain about it for a couple hours and just cant figure it out. What I have is an inclined plane (30 degrees from horizontal). On this plane there are 2 lines, 20 degrees apart. What I need to figure out is how to calculate the angle between the two lines when they are projected to the horizontal plane, as shown in the picture (I am looking for the "In Plane Angle").

Regards,
JT

2. Hi Jt,

I don't if this is the simpler solution, but it's a solution

We need to find the coordinates of the 2 points lying on the inclined plane. I don't know if you have those available, but I'm assuming the worst case, which is not.

Let's throw some names:

$\theta$: is half the angle between the lines (10deg in your example)
$\alpha$: is the angle between the planes (30deg in your example)
$P0$: is the point where the 2 lines intercept. I'm assuming this will always be the origin, like in your picture
$P1$ and [tex]P2[\math]: are the points that define the $\theta$ angle

I'll take these points first lying on the horizontal plane, then rotate them by $\alpha$ degrees to find the new coordinates.

$P0=(0, 0, 0)$
$P1=(sin(\theta), cos(\theta), 0)$
$P2=(-sin(\theta), cos(\theta), 0)$

They will rotate about the X axis. The rotation matrix for this axis is:

$Rx=\left(\begin{array}{ccc}1&0&0\\0&cos(\alpha)&-sin(\alpha)\\0&sin(\alpha)&cos(\alpha)\end{array}\ right)$

Multiply the point by the matrix and you have the coordinates of the rotated point:

$P1r=Rx*P1$
$P2r=Rx*P2$

This 2 points are now projected on the horizontal plane. In this particular case x and y coordinates are the same, and z = 0. So, the projected points are:

$P1p=(sin(\theta), cos(\theta)*cos(\alpha), 0)$
$P2p=(-sin(\theta), cos(\theta)*cos(\alpha), 0)$

These 2 points make 2 vector with the origin:

$u=P1-P0$
$v=P2-P0$

These 2 vector lie on the horizontal plane, now just find the angle between them using the definition of dot product:

$cos(\theta projected)=\frac{u.v}{|u|*|v|}$

$\theta projected=arccos \frac{cos(\theta)^2*cos(\alpha)^2-sin(\theta)^2}{cos(\theta)^2*cos(\alpha)^2+sin(\th eta)^2}$

Finally, for your example we have $\theta projected=23.01678deg$

I tried to give you all the steps so you could understand where the answer came from. I hope that was it you needed =)

Best regards,
Rodrigo Basniak

3. Thank you Rodrigo.

I am going to be using this with different cases (the angle between planes will change). My end goal is to find the X and Y coordinates of the end points of the vectors. I drew the example up in AutoCAD, and can therefore check the angle measurement.... In this example CAD is giving me 22.7959deg, which is different than the math from your example gives. Any thoughts?