0
0
NumPydata~5 mins

Trigonometric functions (sin, cos, tan) in NumPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the numpy function np.sin() compute?
The function np.sin() computes the sine of each element in the input array, where the input is in radians.
Click to reveal answer
beginner
How is the cosine function represented in numpy?
The cosine function is represented by np.cos(), which calculates the cosine of each input value in radians.
Click to reveal answer
beginner
What is the output of np.tan(np.pi / 4)?
The output is 1.0 because the tangent of 45 degrees (π/4 radians) is 1.
Click to reveal answer
intermediate
Why do numpy trigonometric functions expect input in radians, not degrees?
Because radians are the standard unit for angles in mathematical functions and calculations, numpy functions like np.sin(), np.cos(), and np.tan() expect input in radians for accuracy and consistency.
Click to reveal answer
beginner
How can you convert degrees to radians before using numpy trigonometric functions?
You can convert degrees to radians using np.radians(degrees), which converts degree values to radians for use in np.sin(), np.cos(), and np.tan().
Click to reveal answer
What does np.cos(np.pi) return?
A1.0
B0.0
CUndefined
D-1.0
Which numpy function calculates the tangent of an angle?
Anp.sin()
Bnp.arctan()
Cnp.tan()
Dnp.cos()
If you have an angle in degrees, which function helps convert it to radians?
Anp.degrees()
Bnp.radians()
Cnp.sin()
Dnp.tan()
What is the value of np.sin(0)?
A0
B1
C-1
DUndefined
Which unit should angles be in when using np.sin(), np.cos(), or np.tan()?
ARadians
BDegrees
CGradians
DTurns
Explain how to calculate the sine, cosine, and tangent of an angle using numpy, including any necessary unit conversions.
Think about the input unit and the numpy functions for each trig function.
You got /3 concepts.
    Describe a real-life example where you might use numpy's trigonometric functions in data science.
    Consider situations involving cycles or angles.
    You got /3 concepts.