Magnetic Field & Force API
Magnetic fields and forces as an API, computed locally and deterministically. The wire endpoint computes the magnetic field around a long straight current-carrying wire, B = μ0·I/(2π·r) — the field at a distance r from a wire carrying a current I — and solves for whichever of the current, the distance or the field you leave out, reporting the field in tesla, millitesla, microtesla and gauss. The solenoid endpoint gives the uniform field inside a long solenoid, B = μ0·n·I (n turns per metre, given directly or as a total number of turns over a length), or the field at the centre of a circular loop, B = μ0·N·I/(2R). The force endpoint computes the magnetic force on a moving charge, F = q·v·B·sin(θ) (the Lorentz force), or on a current-carrying wire in a field, F = B·I·L·sin(θ), with the force per metre. The vacuum permeability μ0 = 4π×10⁻⁷ is built in, with an optional relative permeability for a magnetic core. Everything is computed locally and deterministically, so it is instant and private. Ideal for electromagnetism-education tools, electromagnet, motor and inductor design, magnetic-sensor and physics-simulation apps. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is magnetostatics; for Coulomb electrostatics use a Coulomb API and for Ohm's-law circuits use an Ohm's-law API.
api.oanor.com/magnetic-api