{"id":25388,"date":"2021-11-10T09:38:46","date_gmt":"2021-11-10T04:08:46","guid":{"rendered":"https:\/\/python-programs.com\/?p=25388"},"modified":"2021-11-10T09:38:46","modified_gmt":"2021-11-10T04:08:46","slug":"python-math-degrees-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-math-degrees-method-with-examples\/","title":{"rendered":"Python math.degrees() Method with Examples"},"content":{"rendered":"
math.degrees() Method in Python:<\/strong><\/p>\n The math. degrees() method converts a radian angle to a degree angle.<\/p>\n PI (3.14… ) radians are equal to 180 degrees, so 1 radian equals 57.2957795 degrees.<\/p>\n Syntax:<\/strong><\/p>\n Parameters<\/strong><\/p>\n x:<\/strong> This is Required. It is a number. A radian value that can be converted into a degree value.<\/p>\n If the parameter is not a number, a TypeError is returned.<\/p>\n Return Value:<\/strong><\/p>\n Returns a float value indicating the value in degrees.<\/p>\n Examples:<\/strong><\/p>\n Example1:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Example2:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n Similarly, try for other numbers.<\/p>\n Output:<\/strong><\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n math.degrees() Method in Python: The math. degrees() method converts a radian angle to a degree angle. PI (3.14… ) radians are equal to 180 degrees, so 1 radian equals 57.2957795 degrees. Syntax: math.degrees(x) Parameters x: This is Required. It is a number. A radian value that can be converted into a degree value. If the …<\/p>\nmath.degrees(x)<\/pre>\n
Given Angle = 7.5<\/pre>\n
The given angle{ 7.5 } in degrees = 429.7183463481174<\/pre>\n
Given Angle = 14<\/pre>\n
The given angle{ 14 } in degrees = 802.1409131831525<\/pre>\n
math.degrees() Method with Examples in Python<\/h2>\n
\n
Method #1: Using Built-in Functions (Static Input)<\/h3>\n
\n
# Import math module using the import keyword\r\nimport math\r\n# Give the number(angle) as static input and store it in a variable.\r\ngvn_angl = 7.5\r\n# Pass the given angle as an argument to the math.degrees() function that\r\n# converts the given radian angle to a degree angle.\r\n# Store it in another variable.\r\ndegre_angl = math.degrees(gvn_angl)\r\n# Print the given angle in degrees.\r\nprint(\"The given angle{\", gvn_angl, \"} in degrees = \", degre_angl)\r\n<\/pre>\n
The given angle{ 7.5 } in degrees = 429.7183463481174<\/pre>\n
import math\r\ngvn_angl = 4\r\ndegre_angl = math.degrees(gvn_angl)\r\nprint(\"The given angle{\", gvn_angl, \"} in degrees = \", degre_angl)\r\n<\/pre>\n
The given angle{ 4 } in degrees = 229.1831180523293<\/pre>\n
Method #2: Using Built-in Functions (User Input)<\/h3>\n
\n
# Import math module using the import keyword\r\nimport math\r\n# Give the number(angle) as user input using the float(input()) function \r\n# and store it in a variable.\r\ngvn_angl = float(input(\"Enter some random number = \"))\r\n# Pass the given angle as an argument to the math.degrees() function that\r\n# converts the given radian angle to a degree angle.\r\n# Store it in another variable.\r\ndegre_angl = math.degrees(gvn_angl)\r\n# Print the given angle in degrees.\r\nprint(\"The given angle{\", gvn_angl, \"} in degrees = \", degre_angl)\r\n<\/pre>\n
Enter some random number = -10.5\r\nThe given angle{ -10.5 } in degrees = -601.6056848873644<\/pre>\n","protected":false},"excerpt":{"rendered":"