NumPy Trigonometric Functions – Np.Sin(), Np.Cos(), Np.Tan()
NumPy Trigonometric Functions
NumPy supports trigonometric functions like sin, cos, and tan, etc. The NumPy trigonometric functions help to solve mathematical trigonometric calculation in an efficient manner.
np.sin() Trigonometric Function
The np.sin() NumPy function help to find sine value of the angle in degree and radian.
Syntax: sin(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj])
Sine value of angle in degrees
1 2 3 |
|
1 2 |
|
Sine value of the angle in radians
To get sine value of the angle in radians, need to multiply angle with np.pi/180.
np.pi = 3.14
1 2 |
|
1 2 |
|
Learn more about python NumPy click here.
np.cos() Trigonometric Function
The np.cos() NumPy function help to find cosine value of the angle in degree and radian.
Syntax: cos(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj])
Cosine value of angle in degrees
1 2 3 |
|
1 2 |
|
Cosine value of the angle in radians
To get cosine value of the angle in radians, need to multiply angle with np.pi/180.
np.pi = 3.14
1 2 |
|
1 2 |
|
np.tan() Trigonometric Function
The np.tan() NumPy function help to find tangent value of the angle in degree and radian.
Syntax: tan(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj])
Tangent value of angle in degrees
1 2 3 |
|
1 2 |
|
Cosine value of the angle in radians
To get the tangent value of the angle in radians, need to multiply angle with np.pi/180.
np.pi = 3.14
1 2 |
|
1 2 |
|
Graphical Representation of Trigonometric sine Function
1 2 3 4 5 6 7 8 9 |
|
Output >>>
Graph of np.sin() function
Graphical Representation of Trigonometric Cosine Function
1 2 3 4 5 6 7 8 9 |
|
Output >>>
Graph of np.cos() function
Graphical Representation Of Trigonometric Tangent Function
1 2 3 4 5 6 7 8 9 |
|
Output >>>
Graph of np.tan() function
Note: To get the value of Numpy trigonometric functions, need to multiply angle value with np.pi/180 because all trigonometric functions accept by default value as degrees.
Conclusions
In NumPy trigonometric function blog, We learn how to use np.sin(), np.cos() and np.tan() mathematical trigonometric functon. According to your requirement give argument as degrees or radians value to respective function.
Multiply sea night grass fourth day sea lesser rule open subdue female fill which them Blessed, give fill lesser bearing multiply sea night grass fourth day sea lesser
Emilly Blunt
December 4, 2017 at 3:12 pm