Skip to content

Commit 68edbdb

Browse files
Update magnetic_flux.py
Fitting to ruff.yml
1 parent ce63ace commit 68edbdb

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

physics/magnetic_flux.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""
2-
Magnetic flux (Φ) is a scalar quantity that measures the number of magnetic field lines (B)
3-
that pass through a closed area (A). Furthermore, the magnetic flux depends on the angle
4-
formed between the magnetic field and the normal line (N) in area A. Check out the formula
5-
used to calculate this flux:
2+
________________________________________________________________________________________
3+
Magnetic flux (Φ) is a scalar quantity that measures the number of magnetic field
4+
lines (B) that pass through a closed area (A). Furthermore, the magnetic flux depends
5+
on the angle formed between the magnetic field and the normal line (N) in area A.
6+
Check out the formula used to calculate this flux:
67
------------
78
| Φ = B.A.cos(θ) |
89
------------
@@ -15,8 +16,7 @@
1516
(Description adapted from https://en.wikipedia.org/wiki/Ideal_gas_law )
1617
"""
1718

18-
from math import cos, radians as deg_to_rad
19-
19+
from math import cos, radians
2020

2121
def check_args(
2222
magnetic_field: float,
@@ -75,8 +75,8 @@ def magnetic_flux(
7575
... ValueError: Invalid area. Should be a positive number.
7676
"""
7777
check_args(magnetic_field, area, angle)
78-
radians = deg_to_rad(angle)
79-
return magnetic_field * area * cos(radians)
78+
rad = radians(angle)
79+
return magnetic_field * area * cos(rad)
8080

8181

8282
if __name__ == "__main__":

0 commit comments

Comments
 (0)