Home >>PHP Math Functions >PHP tan() Function

PHP tan() Function

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 Values

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>
Output:
0
1.5574077246549
14.101419947172
-1.5574077246549

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>
Output:
0
0.57735026918963
1
1.7320508075689

No Sidebar ads