PHP tan() Function
Complete PHP Math Reference
Definition and Usage
The tan() function returns a number that represents the tangent of an angle.
Syntax
| Parameter |
Description |
| x |
Required. A number |
Example
In this example we will get the tangent of different numbers:
<?php
echo(tan(M_PI_4) . "<br />");
echo(tan(0.50) . "<br />");
echo(tan(-0.50) . "<br />");
echo(tan(5) . "<br />");
echo(tan(10) . "<br />");
echo(tan(-5) . "<br />");
echo(tan(-10))
?>
The output of the code above will be:
1
0.546302489844
-0.546302489844
-3.38051500625
0.648360827459
3.38051500625
-0.648360827459
Complete PHP Math Reference
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]