Languages
[Edit]
EN

Python - math.cos() method example

0 points
Created by:
DoLLot
614

The math.cos() function returns the cosine of the specified angle in radians in the range -1 to +1.

Note: 6.123233995736766e-17, -1.8369701987210297e-16 and 6.123233995736766e-17 should be equal to 0 but they are not because of computation precision error.


1. Documentation

Edit
Syntax
Parametersnumber - double value in radians.
Result

returns a numeric value between -1 and +1, which represents the cosine of the angle.

Descriptioncos is a method that takes only one parameter and returns an approximation of cos(x) mathematical function result.

2. Working with radians

Edit

Output: 

3. Working with degrees

Edit

Output: 

4. Reversed console plot example

Edit

Output: 

References

Edit
  1. Cosine - Wikipedia

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Python - math module

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join