rad2deg

array_api_extra.rad2deg(x, /, *, xp=None)

Convert angles from radians to degrees.

Parameters:
  • x (object) – Input array in radians. Must have an integral or floating-point dtype.

  • xp (ModuleType | None) – The standard-compatible namespace for x. Default: infer.

Returns:

The corresponding angles in degrees. Integral inputs are converted to the default floating-point dtype.

Return type:

object

Examples

>>> import array_api_strict as xp
>>> import array_api_extra as xpx
>>> xpx.rad2deg(xp.asarray([0.0, xp.pi / 2, xp.pi]), xp=xp)
Array([  0.,  90., 180.], dtype=array_api_strict.float64)