PHP cos() Function Example

PHP cos() Function Example


Posted in : PHP Posted on : January 28, 2011 at 6:14 PM Comments : [ 0 ]

If you want to get cosine of the arg parameter(in radian) then use cos() function.

PHP cos() Function Example:

If you want to get cosine of the arg parameter(in radian) then use cos() function.

Syntax:

cos(x)

where x is required parameter in radian.

Example:

<?php
echo (cos(-5)."<br />");
echo (cos(0) . "<br />");
echo (cos(-1) . "<br />");
echo (cos(1) . "<br />");
echo (cos(5));
?>

After running this example the output is:

Output:

0.28366218546323
1
0.54030230586814
0.54030230586814
0.28366218546323

Download Example Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics