Skip to content

Javascript applet for physics education. Allows students to see electric field lines and equipotential lines for any arbitrary arrangement of charges in 2d

License

Notifications You must be signed in to change notification settings

nathanieltagg/fieldlines

Repository files navigation

Field Line Applet

Applet by Nathaniel Tagg, Physics Department, Otterbein University

This is a small web page that creates maps of electric field lines using Javascript in HTML5, intended for educational use.

Feel free to link directly to the live version at http://nathanieltagg.github.io/fieldlines

You are free to use this in your own projects, but please let me know and give me credit if you do so.

About the simulation:

Interestingly, drawing field lines is not closed-form soluable. This applet works by a 'shooting' approximation.

The first charge is generated with a set of field lines coming out with equal spacing. This lines are then traced along the direction of the field until the line either connects to another charge or gets very far out of the simulation box.

However, this creates connecting lines to some of the other charges, using up some of the 'nodes' that should be radiating from that charge. The simulation attempts to fast and dirty work to try to even out the remaining lines. Generally speaking, however, it is NOT possible to have lines radiating outward at equal angles from all charges when the charges have finite size.

This simulation could probably be improved by iterating on the field lines, and backtracking foward and back between charges to try to even out the spacing, but this would make the simulation non-responsive.
Source code is available for forking at https://github.com/nathanieltagg/fieldlines

Other work:

See also a 3D version of this work: https://github.com/Awesomeology/EField3d

Nathaniel Tagg, Dec 2014

About

Javascript applet for physics education. Allows students to see electric field lines and equipotential lines for any arbitrary arrangement of charges in 2d

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published