math.cos()
Anonymous contributor
Anonymous contributor186 total contributions
Anonymous contributor
Published May 19, 2021Updated Mar 17, 2024
Contribute to Docs
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))
The above code gives the following output:
-0.4480736161291702
Codebyte Example
Run the following example that uses the math.cos()
function to understand its working:
All contributors
- Anonymous contributorAnonymous contributor186 total contributions
- ishg-15328 total contributions
- cslylla58 total contributions
- christian.dinh2476 total contributions
- Anonymous contributorAnonymous contributor3071 total contributions
- Anonymous contributor
- ishg-153
- cslylla
- christian.dinh
- Anonymous contributor
Contribute to Docs
- 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.