20 lines
321 B
Markdown
20 lines
321 B
Markdown
---
|
|
title: degrees_to_rads
|
|
tags: math,beginner
|
|
---
|
|
|
|
Converts an angle from degrees to radians.
|
|
|
|
- Use `math.pi` and the degrees to radians formula to convert the angle from degrees to radians.
|
|
|
|
```py
|
|
from math import pi
|
|
|
|
def degrees_to_rads(deg):
|
|
return (deg * pi) / 180.0
|
|
```
|
|
|
|
```py
|
|
degrees_to_rads(180) # ~3.1416
|
|
```
|