degrees()#

Converts a radian measurement to its corresponding value in degrees.

Examples#

1def setup():
2    rad = py5.PI/4
3    deg = py5.degrees(rad)
4    # prints "0.7854 radians is 45.0 degrees"
5    py5.println(round(rad, 5), 'radians is', round(deg, 5), 'degrees')

Description#

Converts a radian measurement to its corresponding value in degrees. Radians and degrees are two ways of measuring the same thing. There are 360 degrees in a circle and 2*PI radians in a circle. For example, 90° = PI/2 = 1.5707964. All trigonometric functions in py5 require their parameters to be specified in radians.

This function makes a call to the numpy degrees() function.

Syntax#

degrees(radians: Union[float, npt.ArrayLike]) -> Union[float, npt.NDArray]

Parameters#

  • radians: Union[float, npt.ArrayLike] - radian value to convert to degrees

Updated on February 26, 2022 13:22:44pm UTC