Calculating the angle in a triangle over time when the length of all three edges is known and when one of the angles is 90 degrees.

3 views (last 30 days)
I want to calculate the angle over time (101 samples). x,y,z coordinates of all three points are known over time and the angle of p3 is always 90 degrees. Since all coordinates of the three points are known, the length of all three edges is known.
The angle is negative when p1 is at the left side of p3.
How do I calculate the angle? I used acos before, but all negative angles become positive when using acos.

Answers (1)

Torsten
Torsten on 28 Mar 2018
if x_coordinate of p1 > x_coordinate of p3
angle = 180/pi*acos(...);
else
angle = -180/pi*acos(...);
end

Categories

Find more on Computational Geometry in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!