Home▸Rendering & Computer Graphics▸Space Anomaly Field: Gravitational Lensing & Ray Deflection (2D)

Space Anomaly Field: Gravitational Lensing & Ray Deflection (2D)

Point-mass space anomalies bend a field of light rays through real Newtonian inverse-square gravity — tune anomaly count, mass intensity, ray density and a detection threshold, then watch rays curve and get flagged as their deflection angle grows.

Rendering & Computer Graphics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-interactive-space-anomaly-control-system ↗ Open standalone

The 3D original is a decorative slider dashboard — its "anomaly", "intensity" and "frequency" controls only randomize opacity and scale on a scatter of meshes, with no formula connecting them. This 2D companion keeps the same anomaly-field theme but drives it with real physics: each anomaly is a point mass, each light ray is a free-falling test particle integrated step by step under Newtonian inverse-square gravity from every anomaly in the field, and the on-screen deflection angle is the ray's actual accumulated turn away from its initial straight path rather than a random number.

⚙ Under the hood

2D gravitational-lensing lab: point-mass space anomalies bend a field of light rays via real inverse-square gravity, with live deflection-angle and detection readouts.

gravitational lensinginverse-square gravityn-bodyray deflectionspace anomaly

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

Why does a ray sometimes loop back instead of just bending slightly?

If a ray passes close enough to a high-mass anomaly, the inverse-square pull grows fast enough (softened near-singularity aside) that its velocity vector rotates by a large angle in a short distance — the same qualitative behavior as a close gravitational flyby.

What does the detection threshold actually measure?

It's a cutoff, in degrees, on the ray's accumulated deflection angle (the angle between its current velocity and its original horizontal heading). Rays that cross it are flagged and counted in the "Detected" readout.

What did you find?

Add reproduction steps (optional)