# Define the angle of the line which has two different points in 3D

I have 2 points different points in 3D space $$(x_1,y_1,z_1)$$ and $$(x_2,y_2,z_2)$$. These are not on the origin. It creates a vector and I would like to define the angle between this vector and normal vector of the plane laid down on the $$X$$-$$Y$$ plane.

• Basically what is your question here – Vedant Chourey May 13 at 14:20
• my question is how to define this angle. – agenel May 13 at 14:52
• The answer is given – Vedant Chourey May 13 at 14:53

Assuming define means determine the angle, viewing this vector as a true length looking on the edge of the $$X$$-$$Y$$ plane, the angle $$L$$ between the vector and the plane is:
$$L = \arctan(\frac{z_2 - z_1}{\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}})$$
The angle to the normal vector is therefore $$90 - L$$.