Numpy radians() method

This function is used to convert the angles from degrees to radians.

Syntax

snippet
numpy.radians(array, out)

Parameters

  1. array: these are the angles whose radians values are to be calculated.
  2. Out: It is the shape of the output array.

Return

It returns an array containing equivalent radians angles of the degrees given in the input array.

Example

snippet
import numpy as np 

arr = [0, 30, 60, 90 ] 
print ("Input array : \n", arr) 

radval = np.radians(arr) 
print ("\n Radian value : \n", radval)

Output:

Output
Input array : [0, 30, 60, 90] Radian value : [0. 0.52359878 1.04719755 1.57079633]
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents