On this page
math.cos
Prev: math.copysign | Up: math | Next: math.cosh
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.cos
Tags: #public #python3 #stdlib #math
Import
import math
from math import cos
Signature & Overview
math.cos(x, /)
Return the cosine of x (measured in radians).
Usage
import math
assert math.isclose(math.cos(0.0), 1.0)
assert math.isclose(math.cos(math.pi), -1.0)
Gotchas
- Input is in radians: Convert degrees with
math.radians(deg)first.
REPL Inspect
from math import cos
help(cos)
Linked from
Related notes
- tuts/python3/stdlib_module/math/copysign Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/cosh Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/math/acos Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/acosh Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asin Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asinh Linked here; shared tags: #math, #stdlib
- tuts/c/stdlib/math shared tags: #math, #stdlib
- tuts/c/stdlib/math/fabs shared tags: #math, #stdlib
- tuts/c/stdlib/math/floor shared tags: #math, #stdlib