echo acos(0); // Output is 1.5707963267949
echo "<br>";
echo acos(1); // Output  0
echo "<br>";
echo acos(-1); // Output is 3.1415926535898
echo "<br>";
echo acos(-5); // Output is NAN 
X is the angular value in radian. We get output as acos of the input angle.

It takes input range from +1 to -1 , for any other input it returns NAN ( not a number ). How to check the output by using is_nan() ?

deg2rad() with acos()

We can use deg2rad() to convert Degree value to radian and then use acos().
echo acos(deg2rad(0)); // 1.5707963267949
echo "<br>";
echo acos(deg2rad(90)); // NAN
echo "<br>";
echo acos(deg2rad(180)); // NAN 


Plotting of SIN & SIN curves by using PHP GD function with deg2rad()
MIN() function
Math Functions
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer