PHP tan() Function
Example
Return 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));
?>
Try it Yourself »
Definition and Usage
The tan() function returns the tangent of a number.
Syntax
tan(number);
Parameter Values
Parameter | Description |
---|---|
number | Required. Specifies a value in radians |
Technical Details
Return Value: | The tangent of number |
---|---|
Return Type: | Float |
PHP Version: | 4+ |
❮ PHP Math Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.