Math Functions

math.cos()

Compute cosine of an angle in radians.

Formal Syntax & Structure

python syntaxpython
math.cos(x, /)

Parameters & Attributes

NameTypeDescription
xreal numberInput real value.

Return Value

float

Floating-point result; finite precision and domain restrictions apply.

Working Example

Example Snippetpython
import mathprint(math.cos(0))
Python Reference