Lesson 8 of 15
Magnetic Field of a Wire
Long Straight Wire
A current-carrying wire creates a magnetic field that wraps around it in concentric circles. The field strength at distance r from an infinite straight wire:
B = rac{mu_0 I}{2pi r}
- B — magnetic field (tesla, T)
- T·m/A — permeability of free space
- I — current (amperes)
- r — perpendicular distance from wire (m)
The Direction
Use the right-hand rule: point your thumb in the direction of current flow; your fingers curl in the direction of the magnetic field.
Simplification
Since T·m/A exactly, the formula simplifies to:
B = rac{2 imes 10^{-7} cdot I}{r}
Examples
| I (A) | r (m) | B (T) |
|---|---|---|
| 1 | 1 | 2.00e-07 |
| 10 | 1 | 2.00e-06 |
| 1 | 0.1 | 2.00e-06 |
| 100 | 0.5 | 4.00e-05 |
Your Task
Implement wire_magnetic_field(I, r) returning B in tesla ().
Pyodide loading...
Loading...
Click "Run" to execute your code.