[Math] Compute the angle between two points on a plane, given the normal vector of the plane

3dangleeuclidean-geometryvectors

I have a 3d polyhedron for which I know the normal angle of each face.

I want to compute the bearing between two points on the same face, given their Cartesian coordinates.

My hunch was to use SVD to rotate to points into their natural axes,and extract the Euler angles in each dimension from the rotation matrix, which I have done. But I'm not really sure how (or if) to go from there.

EDIT:
The bearing with respect to the plane. That is, if the the polyhedron was a cube who's edges were parallel to the axes, then the problem reduces to the 2D bearing, as discussed here becuase the two points would have equal values in one dimension. Essentially, I want to solve that problem when my plane is not the xy plane, but I know its normal.

EDIT2: If my surface were a sphere of known radius, I could compute the latitude and longitude from the Cartesian coordinates and then calculate the azimuth from one point to the other. I want a value analogous to the azimuth for a polyhedral surface, given that the points are on the same face.

Best Answer

The "bearing" between two points $(x_1,y_1,z_1)$ and $(x_2,y_2,z_2)$ depends upon the point $(x_0,y_0,z_0)$ from which one is taking the bearing.

If $\vec{u}=\langle x_1-x_0,y_1-y_0,z_1-z_0\rangle$ and $\vec{v}=\langle x_2-x_0,y_2-y_0,z_2-z_0\rangle$ then one only needs the law of cosines to find the angle $\theta$ between vectors $\vec{u}$ and $\vec{v}$.

$$\cos\theta=\frac{\vec{u}\cdot\vec{v}}{\Vert\vec{u}\Vert\cdot\Vert\vec{v}\Vert}$$