my first post here. Ive got a rather simple question and hope there have not been similar ones - I dont even know what I should search for.
Now my Question: I am trying to develop an AR-App and came to the following problem.
I have got the location P1 and P2 with their coordinates and the orientation of the object in degress from north. The object itself is at P2 and always placed in a line with P1 and P2.
My questions is, how do I calculate the angle for the actual rotation depending on the position between the two locations. The shown picture is doing fine for the given case, however the formular is not generally valid. I guess there are several cases on how to do it correctly.
Any thoughts will be appreciated.