Facebook Page Twitter Page LinkedIn Page
× PHP Tutorial PHP Advanced PHP Resources


The PHP Math tan() function returns trigonometric tangent of an angle (angle should be in radians).

Syntax

tan(number)

Parameters

arg Required. Specify the angle in radian.

Return Value

Returns the trigonometric tangent of an angle.

Example:

In the below example, tan() function is used to find out the trigonometric tangent of an angle.

<?php
echo tan(pi()/6)."\n";
echo tan(pi()/4)."\n";
echo tan(pi()/3)."\n"; 
?>

The output of the above code will be:

0.57735026918963
1
1.7320508075689

❮ PHP Math Functions