mxnet.np.radians

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

Convert angles from degrees to radians.

Parameters
  • x (ndarray or scalar) – Input array in degrees.

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

Returns

  • y (ndarray) – The corresponding radian values. This is a scalar if x is a scalar.

  • .. note:: – This function differs from the original numpy.radians in the following way(s):

    • only ndarray or scalar is accpted as valid input, tuple of ndarray is not supported

    • broadcasting to out of different shape is currently not supported

    • when input is plain python numerics, the result will not be stored in the out param

Examples

>>> deg = np.arange(12.) * 30.
>>> np.radians(deg)
array([0.       , 0.5235988, 1.0471976, 1.5707964, 2.0943952, 2.6179938,
       3.1415927, 3.6651914, 4.1887903, 4.712389 , 5.2359877, 5.7595863],
       dtype=float32)