Angle between two 3D points on a plane.,

I have two 3D points on a plane. When the plane is on the z-axis I can easily calculate the angle between the two using

Vector3 diff = (pos1- pos2); float angle = Mathf.Atan2(diff.y, diff.x) * Mathf.Rad2Deg;

How would I go about solving this when the plane is on some other angle where its not parallel to any axis and I would have to use all x,y,z coordinates to solve it. My best idea right now is to convert this 3D position into a 2D since I know the angle of the plane and use the same method as above but I feel like there has to be some mathematical solution.

Thanks,

Hello there!

First, 2 points can not hav an angle. Only 2 planes (or 2 vectors) can have an angle between them.

Just use:

Bye!!