diff --git a/snippets/rads_to_degrees.md b/snippets/rads_to_degrees.md new file mode 100644 index 000000000..501ef1e74 --- /dev/null +++ b/snippets/rads_to_degrees.md @@ -0,0 +1,20 @@ +--- +title: rads_to_degrees +tags: math,beginner +--- + +Converts an angle from radians to degrees. + +Use `math.pi` and the radian to degree formula to convert the angle from radians to degrees. + +```py +import math + +def rads_to_degrees(rad): + return (rad * 180.0) / math.pi +``` + +```py +import math +rads_to_degrees(math.pi / 2) # 90.0 +```