-
-
Notifications
You must be signed in to change notification settings - Fork 35
feat: add interactive Magnetic Field simulation #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -143,6 +143,45 @@ function draw(){ | |||||
| ], | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| id: 8, | ||||||
| name: "Magnetic Field", | ||||||
| desc: "Charged particle motion in a uniform magnetic field (B out-of-plane).", | ||||||
| link: "/simulations/MagneticField", | ||||||
| tags: [TAGS.MEDIUM, TAGS.PHYSICS], | ||||||
| icon: "/icons/magnetic.png", | ||||||
| theory: { | ||||||
| sections: [ | ||||||
| { | ||||||
| title: "Introduction", | ||||||
| blocks: [ | ||||||
| { | ||||||
| type: "paragraph", | ||||||
| text: "A charged particle moving in a uniform magnetic field experiences the Lorentz force, producing circular motion when the velocity is perpendicular to the field. Use the draggable particle to set initial velocity and observe the resulting trajectory.", | ||||||
|
||||||
| text: "A charged particle moving in a uniform magnetic field experiences the Lorentz force, producing circular motion when the velocity is perpendicular to the field. Use the draggable particle to set initial velocity and observe the resulting trajectory.", | |
| text: "A charged particle moving in a uniform magnetic field experiences the Lorentz force, producing circular motion when the velocity is perpendicular to the field. In this simulation, you can drag the rod to change its orientation, hold Shift while dragging to move it, and use the controls to toggle the visibility of magnetic field lines.", |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||
| import { EARTH_G_SI } from "../../constants/Config.js"; | ||||||
|
|
||||||
|
Comment on lines
+1
to
+2
|
||||||
| import { EARTH_G_SI } from "../../constants/Config.js"; |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable vel.
| const { pos, vel } = state || {}; | |
| const { pos } = state || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description states "Charged particle motion in a uniform magnetic field (B out-of-plane)" but the simulation does not actually implement particle motion. The description should be updated to accurately reflect that this simulation visualizes magnetic dipole field lines and allows manipulation of the rod orientation, not charged particle motion.