2

I am trying to find the angle of a triangle I have complete most of the work using this formula

enter image description here now Problem is that how to find cos inverse in PHP I have the code below to find the cosine inverse

echo acos(42/90);

it returns a float value, not angle.

john
  • 25
  • 1
  • 5

1 Answers1

4

Trigonometric functions work with radians, not degrees, so you have to calculate

$AngleInDegrees = rad2deg(acos(42/90))
or
$AngleInDegrees = acos(42/90) * 180 / Pi();
MBo
  • 77,366
  • 5
  • 53
  • 86