01/ Newtonian Two-Body Gravitational Dipoles
In classical celestial mechanics, a gravitational dipole configuration consists of two localized mass centers $m_1$ and $m_2$ separated by a displacement vector $\vec{d}$. Unlike electromagnetic dipoles—which feature equal and opposite charges ($+q$ and $-q$)—standard gravitational systems feature positive masses ($m_1, m_2 > 0$) attracting one another governed by Newton's universal gravitational law:
The total gravitational potential $\Phi(\vec{r})$ at any spatial coordinate $\vec{r}$ is expressed as the scalar superposition of potentials generated by both masses:
Interactive Gravitational Dipole Engine
Hardware-Accelerated WebAssembly Render (Rust + Macroquad + Egui)
Live WebAssembly interactive render. Click inside canvas to interact.
02/ Gravitational Multipole Expansion
When observed at distance $r \gg d$, the potential field can be expanded into Legendre polynomials $P_l(\cos\theta)$, separating monopole, dipole, and quadrupole moments:
Here, $\vec{p}_g = m_1 \vec{r}_1 + m_2 \vec{r}_2$ represents the first mass moment. By shifting the coordinate system origin to the center of mass $\vec{R}_{\text{cm}} = \frac{m_1 \vec{r}_1 + m_2 \vec{r}_2}{m_1 + m_2}$, the dipole term vanishes for strictly positive mass systems ($\vec{p}_g = \vec{0}$).
However, in theoretical metric fields featuring effective negative mass density or asymmetrical warp bubbles (such as Planck mass dipole pairs), the dipole term $\vec{p}_g \neq \vec{0}$ dominates far-field behavior, creating directional acceleration vectors without net global momentum change.
03/ Orbital Energy & Conservation Laws
To maintain trajectory stability over extended numerical steps, the simulation engine calculates total mechanical energy $E = T + V$:
Under fourth-order Runge-Kutta (RK4) numerical integration with adaptive time-stepping $\Delta t$, the engine limits numerical drift to $\mathcal{O}(\Delta t^4)$, conserving angular momentum $\vec{L} = \vec{r} \times \vec{p}$ and preventing artificial orbital collapse.
04/ Engine Implementation Details
The simulation binary gravitational_dipole.wasm is compiled directly from Rust using macroquad for WebGL rendering and egui-macroquad for real-time control parameters.
- Target Architecture:
wasm32-unknown-unknown - Renderer: WebGL 1.0 hardware-accelerated pipeline via Miniquad
- GUI Overlay: Immediate mode GUI with mass ratio sliders, vector field visualization, and field line toggles