degrees() - ( NumPy Functions )
Heading h2
Syntax
numpy.degrees(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj])
Example
import numpy as np
# Convert radians to degrees
rads = np.array([0, np.pi/2, np.pi, 3*np.pi/2])
degrees = np.degrees(rads)
print(degrees)
Output:
[ 0. 90. 180. 270.]
Explanation
The numpy.degrees()
function is used to convert angles from radians to degrees. It takes a single argument x
which is an array of angles in radians and returns an array of angles in degrees. The out
parameter can be used to specify an output array to store the results.
Use
The numpy.degrees()
function is commonly used in scientific and mathematical calculations that involve angles. It is especially useful in applications that involve trigonometry, such as physics and engineering.
Important Points
numpy.degrees()
is used to convert angles from radians to degrees- It takes an array of angles in radians as input and returns an array of angles in degrees
- The
out
parameter can be used to specify an output array to store the results
Summary
In conclusion, the numpy.degrees()
function is used to convert angles from radians to degrees. It takes an array of angles in radians as input and returns an array of angles in degrees. This function is commonly used in scientific and mathematical calculations that involve angles, especially in applications that involve trigonometry.