| ||||||
|
How to calculate the Cosine Arch of a value using PHP
As with most mathematical requirements PHP already has a function in place to help deliver your results. And even for Cosine Arch calculations PHP is not a let down. The function used to calculate the Cosine Arch is simple enough: acos($number) Try out the code below to see how acos() works: <?php echo "acos(0.4) = ".acos(0.4)."<br><br>"; echo "acos(0.7) = ".acos(0.7)."<br><br>"; echo "acos(0.2) = ".acos(0.2)."<br><br>"; echo "acos(0.78473) = ".acos(0.78473)."<br><br>"; ?> The results: acos(0.4) = 1.1592794807274 acos(0.7) = 0.79539883018414 acos(0.2) = 1.3694384060046 acos(0.78473) = 0.66853591781777
|