mxnet.np.degrees

degrees(x, out=None, **kwargs)

Convert angles from radians to degrees.

Parameters
  • x (ndarray) – Input value. Elements must be of real value.

  • out (ndarray or None, optional) – A location into which the result is stored. If provided, it must have the same shape and dtype as input ndarray. If not provided or None, a freshly-allocated array is returned.

Returns

  • y (ndarray) – The corresponding degree values; if out was supplied this is a reference to it. This is a scalar if x is a scalar.

  • .. note:: – This function differs from the original numpy.degrees in the following aspects:

    • Input type does not support Python native iterables(list, tuple, …). Only ndarray is supported.

    • out param: cannot perform auto broadcasting. out ndarray’s shape must be the same as the expected output.

    • out param: cannot perform auto type cast. out ndarray’s dtype must be the same as the expected output.

    • out param does not support scalar input case.

Examples

>>> rad = np.arange(12.) * np.pi / 6
>>> np.degrees(rad)
array([  0.,  30.,  60.,  90., 120., 150., 180., 210., 240., 270., 300., 330.])
>>> # Use specified ``out`` ndarray:
>>> out = np.zeros((rad.shape))
>>> np.degrees(rad, out)
array([  0.,  30.,  60.,  90., 120., 150., 180., 210., 240., 270., 300., 330.])
>>> out
array([  0.,  30.,  60.,  90., 120., 150., 180., 210., 240., 270., 300., 330.])