Home >>PHP Math Functions >PHP tan() Function
PHP tan() function is used to find the tangent of the given argument parameter. It accepts only a single parameter $number which is the number whose tangent value is to be found. Its parameter value must be in radians. It returns a floating point number as output which is the tangent value of given input number passed as argument.
Syntax:
tan(number);
Parameter | Description |
---|---|
number | This is a required parameter. This parameter defines the given input argument. |
Here is an example of tan() function in PHP:
<html> <body> <?php echo tan(0)."<br>"; echo tan(1)."<br>"; echo tan(1.5)."<br>"; echo tan(-1)."<br>"; ?> </body> </html>
Here is an example of tan() function in PHP:
<html> <body> <?php echo tan(0)."<br>"; echo tan(pi()/6)."<br>"; echo tan(pi()/4)."<br>"; echo tan(pi()/3)."<br>"; ?> </body> </html>