Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Numpy exercise
  • pandas
  • Matplotlib
  • Data visulisation
  • EDA
  • Machin Learning
  • Deep Learning
  • NLP
  • Data science
  • ML Tutorial
  • Computer Vision
  • ML project
Open In App
Next Article:
numpy.radians() and deg2rad() in Python
Next article icon

numpy.radians() and deg2rad() in Python

Last Updated : 08 Mar, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report
The numpy.radians() is a mathematical function that helps user to convert angles from degree to radians.
Syntax : numpy.radians(x[, out]) = ufunc 'radians') Parameters : array : [array_like] elements are in degrees. out : [ndaaray, optional]Output array of same shape as x.           2pi Radians = 36o degrees Return : An array with radian values in place of degree values.
  Code #1 : Working Python3
# Python3 program explaining # degrees() function  import numpy as np import math  in_array = np.arange(10.) * 90 print ("Degree values : \n", in_array)  radian_Values = np.radians(in_array) print ("\nRadian values : \n", radian_Values) 
Output :
  Degree values :    [   0.   90.  180.  270.  360.  450.  540.  630.  720.  810.]    Radian values :    [  0.           1.57079633   3.14159265   4.71238898   6.28318531     7.85398163   9.42477796  10.99557429  12.56637061  14.13716694]  
  numpy.deg2rad(x[, out]) = ufunc 'deg2rad') : This mathematical function helps user to convert angles from degrees to radians
Parameters : array : [array_like] elements are in radians. out : [ndaaray, optional]Output array of same shape as x.           2pi Radians = 36o degrees Return : Corresponding angles in radians.
  Code #2 : deg2rad() Equivalent to radians() Python3
# Python3 program explaining # rad2deg() function  import numpy as np import math  degree = np.arange(10.) * 90 print ("Degree values : \n", degree)  radian = np.deg2rad(degree) print ("\nradian values : \n", radian) 
Output :
  Degree values :    [   0.   90.  180.  270.  360.  450.  540.  630.  720.  810.]    radian values :    [  0.           1.57079633   3.14159265   4.71238898   6.28318531     7.85398163   9.42477796  10.99557429  12.56637061  14.13716694]  
 

Next Article
numpy.radians() and deg2rad() in Python

M

mohit gupta_omg :)
Improve
Article Tags :
  • Python
  • Python-numpy
  • Python numpy-Mathematical Function
Practice Tags :
  • python

Similar Reads

    degrees() and radians() in Python
    In geometry and trigonometry, we often switch between degrees and radians. Python’s math module provides two simple functions to handle these conversions:math.radians() – Converts degrees to radiansmath.degrees() – Converts radians to degreesLet’s explore both with examples:math.radians()This functi
    2 min read
    numpy.degrees() and rad2deg() in Python
    The numpy.degrees() is a mathematical function that helps user to convert angles from radians to degrees. Syntax : numpy.degrees(x[, out]) = ufunc 'degrees') Parameters : array : [array_like] elements are in radians. out : [ndaaray, optional] Output array of same shape as x. 2pi Radians = 360 degree
    2 min read
    numpy.rint() in Python
    The numpy.rint() is a mathematical function that rounds elements of the array to the nearest integer. Syntax : numpy.rint(x[, out]) = ufunc ‘rint’) Parameters : array : [array_like] Input array. Return : An array with all array elements being rounded off, having same type and shape as input. Code #1
    2 min read
    numpy.angle() in Python
    numpy.angle() function is used when we want to compute the angle of the complex argument. A complex number is represented by “ x + yi " where x and y are real number and i= (-1)^1/2. The angle is calculated by the formula tan-1(x/y). Syntax : numpy.angle(z, deg=0) Parameters : z : [array_like] A com
    2 min read
    numpy.tan() in Python
    numpy.tan(array[, out]) = ufunc 'tan') : This mathematical function helps user to calculate trigonometric tangent for all x(being the array elements). Parameters : array : [array_like]elements are in radians. out : [optional]shape same as array. 2pi Radians = 360 degrees tan(x) = sin(x) / cos(x) Ret
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences