Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Current loop magnetic field calculator

Project Description

loopfield: compute vector magnetic fields induced by filamentary current loops

loopfile.plot: plot simple 2D visualizations of fields with field lines and thresholded regions

Simple example: calculate field due to single current loop:

#!/usr/bin/env python3

import loopfield as lf

# create empty field with specified units
field = lf.Field(length_units =,
current_units = lf.A,
field_units = lf.uT)

# single-turn 10 cm x-oriented coil at origin
position = [0., 0., 0.]
normal = [1., 0., 0.]
radius = 10.
current = 1.
c = lf.Loop(position, normal, radius, current)

# add loop to field

# evaluate vector field at origin
B = field.evaluate([0., 0., 0.])
print('B = ', B)

See examples for more usage details.

Uses the formulas presented in:

Simpson J., Lane J., Immer C., Youngquist R., Steinrock, T., Simple
Analytic Expressions for the Magnetic Field of a Circular Current
Loop. NASA Technical Report. 2001. Retrieved from

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(5.4 kB) Copy SHA256 Hash SHA256
Source None Jul 20, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers