PHP tan()Functions

PHP Math 参考手册PHP Math Reference Manual

Example

Returns 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));
?>

Run Example »

Definition and Usage

The tan() function returns the tangent of a number.


Syntax

tan(number);

Parameter Description
number Required. Specifies a value in radians.

Technical Details

Return value: numberThe tangent of.
Return type: Float
PHP Version: 4+


PHP Math 参考手册PHP Math Reference Manual Other Extensions