cos()


float cos ( float $arg )

Description

cos() returns the cosine of $arg. The $arg is in radians.

※ available F/W version : all

Parameters

Return values

Returns the cosine of $arg

Example

<?php
$rad = 1.0;

$val1 = cos($rad);
$val2 = acos($val1);

echo "cos($rad) = $val1\r\n";  // OUTPUT: cos(1) = 0.54030230586814
echo "acos($val1) = $val2\r\n";  // OUTPUT: acos(0.54030230586814) = 1
?>

See also

acos()

Remarks

This function is identical to the PHP group’s cos() function.