lordzee lordzee - 1 year ago 72
Java Question

Simple Way to get angles

I made a program that asks the user for 3 lengths and determines if it is equilateral,scalene, isosceles. I want to know how to calculate angles(all 3 sides are given) in Java so that the program determines if it is obtuse or acute or right-angled.Please help me out.

Answer Source

As you know the sides of the triangle, you can find the angles just by following steps below...

In java you can use Math.acos(val) to calculate the Inverse Cosine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download