array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.cos.php', 1 => 'cos', ), 'up' => array ( 0 => 'ref.math.php', 1 => 'Math Functions', ), 'prev' => array ( 0 => 'function.ceil.php', 1 => 'ceil', ), 'next' => array ( 0 => 'function.cosh.php', 1 => 'cosh', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/math/functions/cos.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
cos — Cosine
cos() returns the cosine of the num
parameter. The num
parameter is in radians.
num
An angle in radians
The cosine of num
Example #1 cos() example
<?php
echo cos(M_PI); // -1
?>