math.cos()
The math.cos()
function returns the cosine of an angle.
Syntax
math.cos(n)
The math.cos()
function returns a numeric value between -1 and 1, which represents the cosine of the value n
.
Example
Use math.cos()
to return the cosine of a 90
degree angle:
import mathprint(math.cos(90))# Output: -0.4480736161291702
Codebyte Example
The following example is runnable and uses the math.cos()
function to return the cosine of a number:
All contributors
- cslylla54 total contributions
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- Anonymous contributorAnonymous contributor194 total contributions
- cslylla
- christian.dinh
- Anonymous contributor
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.