Gravity Simulator 2D: Calculating Trajectories

In summary, creating a simple 2D gravity simulator involves using the gravitational force formula and the equation of motion to calculate trajectories for objects flying past a larger body. A coordinate transformation may be necessary to represent the motion in x and y coordinates. However, if the influence of the smaller object on the larger one is considered, the simulation becomes more complicated.
  • #1
Pink panther
1
0
I want to create a simple 2d Gravity simulator where I have a large body i.e. A circle which could be a planet or the sun. I then want to simulate small comets or asteroids traveling past it, crashing into or being pulled into orbit. I know the gravitational force formula but that seems the simple part. What I want to know is how to calculate the trajectories for objects flying past. I guess speed and angle of approach determine whether a smaller object will crash, go past or go into orbit around the larger body. Any explanations or sources would be appreciated.
 
Physics news on Phys.org
  • #2
Hello Pinky, :welcome:

Your gravitational force formula is most likely something like ##\vec F = - {GMm\over |\vec r|^2} \, \hat r##. The equation of motion is ##\vec F = m\vec a## where ##\vec a = {d\vec v \over dt}## and ##\vec v = {d\vec r \over dt}##.
If you want it in x, y coordinates you will need a coordinate transformation at some suitable moment.
That's really all there's to it !

Things become more complicated if you want to can no longer ignore the influence of the smaller m on the big M. Maybe that comes later; for now I interpret your large/small as a permit to ignore the motion of the large body.​
 

1. What is a gravity simulator 2D?

A gravity simulator 2D is a computer program that uses mathematical equations and algorithms to simulate the effects of gravity on objects in a two-dimensional space. It allows users to input parameters such as mass, velocity, and gravitational force to calculate the trajectories of objects in motion.

2. How does a gravity simulator 2D work?

A gravity simulator 2D works by using Newton's laws of motion and the law of universal gravitation to calculate the forces acting on objects in the simulation. These forces are then used to determine the acceleration, velocity, and position of the objects over time, resulting in a trajectory.

3. What is the purpose of using a gravity simulator 2D?

The purpose of using a gravity simulator 2D is to understand and visualize the effects of gravity on objects in motion. It can be used for educational purposes, scientific research, or even for entertainment.

4. Can a gravity simulator 2D be used to model real-life scenarios?

Yes, a gravity simulator 2D can be used to model real-life scenarios as long as the parameters and conditions in the simulation accurately reflect those in the real world. It can be a useful tool for predicting and understanding the behavior of objects in space or on Earth.

5. Are there any limitations to a gravity simulator 2D?

Yes, there are limitations to a gravity simulator 2D. It is a simplified model that does not take into account factors such as air resistance, friction, or the shape of objects. It also assumes that all objects are point masses, which may not always be the case in real-life situations.

Similar threads

  • Classical Physics
Replies
7
Views
823
  • Other Physics Topics
Replies
4
Views
1K
  • Beyond the Standard Models
Replies
2
Views
818
  • Programming and Computer Science
Replies
4
Views
1K
Replies
12
Views
2K
Replies
12
Views
2K
Replies
3
Views
1K
  • Other Physics Topics
Replies
11
Views
2K
  • Other Physics Topics
Replies
12
Views
3K
Replies
1
Views
783
Back
Top