# Visual Pi Dependencies
Canonical public lesson for where pi comes from.
## One picture
Wrap a string around a circle, then straighten it next to the diameter.
The string is a little more than three diameters long:
```text
circumference ≈ 3.14159 × diameter
```
## Simple idea
Pi is the circle ratio:
```text
π = circumference / diameter
```
So:
```text
C = πd
C = 2πr
```
## Dependency map
```text
circle → diameter/radius → circumference → pi ratio
pi → radians → sine/cosine → tangent → trig → calculus motion
```
## Code without imports
```python
PI = 3.141592653589793
def circumference_from_diameter(d):
return PI * d
def circumference_from_radius(r):
return 2 * PI * r
```
Source task: `0ccf545e-6db1-43fe-ba18-54f6e5e85cdd`