Skip to content

uses p5js to calculate the magnetic field around a dipole magnet and visualize the field.

License

Notifications You must be signed in to change notification settings

MajorMilk/Magnetic-Field-Simulation---Visualization

Repository files navigation

Magnetic Field Simulation / Visualization

uses p5js to calculate the magnetic field around a dipole magnet. firefox_sCWLgwOOcZ

Pretty simple, uses this equation

B=(μ0/4π)(m×r^/​​∣r∣^3)

where:

μ0​ is the permeability of free space.

m is the magnetic moment of the dipole, given by the product of the pole strength (m) and the distance between the poles (d): m=m⋅d.

r^ is the unit vector pointing from the location of the magnetic dipole to the point in space where the magnetic field is being calculated.

∣r∣ is the distance from the magnetic dipole to the point in space.

About

uses p5js to calculate the magnetic field around a dipole magnet and visualize the field.

Topics

Resources

License

Stars

Watchers

Forks