Projects

Physics

2D Gravity Simulation

An interactive Newtonian gravity sandbox for experimenting with bodies, fields, and predicted motion.

JavaScript
p5.js
Physics
2D Gravity Simulation preview

Why It Is Useful

The project makes orbital and force interactions visible. Users can change the setup and immediately see how mass, distance, and velocity affect motion.

Problem It Solves

Gravity is conceptually simple but visually hard to reason about once multiple bodies interact at the same time.

Real-World Applications

  • Game physics prototypes where force integration has to be understandable and stable.
  • Educational simulations for mechanics, orbital motion, and vector fields.
  • Debug visualizations for systems that depend on forces or trajectories.

Concepts Used

  • Newtonian attraction
  • Vector math
  • Numerical integration
  • Predicted trajectory rendering

Solution Used

  • Bodies are modeled with position, velocity, mass, and acceleration.
  • The simulation computes pairwise gravitational forces and integrates movement over time.
  • Predicted paths and field-style visuals expose the invisible force model behind the animation.