cos()

Anonymous contributor's avatar
Anonymous contributor
Anonymous contributor's avatar
Anonymous contributor
Published Jun 17, 2023
Contribute to Docs

The cos() function returns the cosine of the angle passed as the argument. The return value is a floating-point number.

Syntax

$result = cos($angle);

Where $angle is the angle in radians.

Codebyte Example

Using cos() to return the cosine of the angle in radians:

us
Visit us
code
Hide code
Code
Output
Hide output
Hide output
Loading...

All contributors

Looking to contribute?

Learn PHP on Codecademy