Angles between 3 points.

Norman P.

New member
Joined
Aug 30, 2022
Messages
3
Given three distinct points in the plane A (x1,y1) ,B (x2,y2), C (x3, y3)
and every point connected by a line segment, creating a triangle. How can I calculate the internal angles?

lengths AB = sqrt((x2 - x1)^2 + (y2 - y1)^2)
AC = sqrt((x3 - x1)^2 + (y3 - y1)^2)
BC = sqrt((x3 - x2)^2 + (y3 - y2)^2)
That's as far as I got.
 
Given three distinct points in the plane A (x1,y1) ,B (x2,y2), C (x3, y3)
and every point connected by a line segment, creating a triangle. How can I calculate the internal angles?

lengths AB = sqrt((x2 - x1)^2 + (y2 - y1)^2)
AC = sqrt((x3 - x1)^2 + (y3 - y1)^2)
BC = sqrt((x3 - x2)^2 + (y3 - y2)^2)
That's as far as I got.
Have you learned the Law of Cosines?

Alternatively, have you learned about the dot product of vectors?

Those are two equivalent methods for finding angles.
 
Thank you so much.
Using the Law of Cosines I was able to come up with this solution
a = AB
b = BC
c = AC
>A = arcos((c² - a² - b²) / -2ab)
>B = arcos((b² - a² - c²) / -2ac)
>C = arcos((a² - b² - c²) / -2bc)
 
I am not sure you got your formulae right (probably mislabeled angles). Consider the case of [imath]a=c=1[/imath] and [imath]b=\sqrt{2}[/imath]. I would expect ">A" to be [imath]90^\circ[/imath], but your formula would produce [imath]45^\circ[/imath].
 
Yes! You're right, I did mislabel, but if you check all three, two are 45 degree and the other is 90.
So overall I'm still pretty proud of myself.
 
Top