Numpy rad2deg() method

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

Syntax

snippet
numpy.rad2deg(array, out)

Parameters

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

Return

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

Example

snippet
import numpy as np 
import math

arr = [0, math.pi/2, math.pi/4, math.pi/6 ] 
print ("Input array : \n", arr) 

degval = np.rad2deg(arr) 
print ("\n Degree value : \n", degval)

Output:

Output
Input array : [0, 1.5707963267948966, 0.7853981633974483, 0.5235987755982988] Degree value : [ 0. 90. 45. 30.]
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +