Given three integer numbers and knowing that they form a valid triangle as:(int side1, int side2, int side3), how can I use a single c++ statement to test if an angle is obtuse | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Given three integer numbers and knowing that they form a valid triangle as:(int side1, int side2, int side3), how can I use a single c++ statement to test if an angle is obtuse

15th Jun 2016, 4:22 PM
Abdulai Torfik
3 Answers
+ 1
If the squares of one side is langer than the sum of squares of the other sides, the opposite angle is obtuse.
16th Jun 2016, 5:57 AM
Karl Theodor
0
Just find the longest side and use the law of cosines only once.
15th Jun 2016, 4:46 PM
钟震宇
钟震宇 - avatar
0
Karl is right it is much easier
16th Jun 2016, 6:05 AM
Vivek Sharma
Vivek Sharma - avatar