Update README.md

This commit is contained in:
Quinta
2024-07-12 16:13:49 +02:00
committed by GitHub
parent 2afc695aba
commit 1d3ec737d3
+16 -5
View File
@@ -18,11 +18,13 @@ The simulator consists of several key components:
The simulator uses Newton's law of universal gravitation to calculate the forces between celestial bodies. The gravitational force between two bodies is given by:
$$ F = G \frac{m_1 m_2}{r^2} $$
$$
F = G \frac{m_1 m_2}{r^2}
$$
Where:
- $F$ is the gravitational force between the two bodies
- $G$ is the gravitational constant ($$6.67430 \times 10^{-11} \, \text{N} \cdot \text{m}^2 / \text{kg}^2$$)
- $G$ is the gravitational constant ($6.67430 \times 10^{-11} \, \text{N} \cdot \text{m}^2 / \text{kg}^2$)
- $m_1$ and $m_2$ are the masses of the two bodies
- $r$ is the distance between the centers of the two bodies
@@ -31,9 +33,18 @@ Where:
The motion of each celestial body is updated using numerical integration. We use a simple Euler method for updating positions and velocities:
1. Calculate the net force on each body
2. Calculate acceleration: $$ \vec{a} = \frac{\vec{F}}{m} $$
3. Update velocity: $$ \vec{v}_{new} = \vec{v}_{old} + \vec{a} \Delta t $$
4. Update position: $$ \vec{x}_{new} = \vec{x}_{old} + \vec{v}_{new} \Delta t $$
2. Calculate acceleration:
```math
$$ \vec{a} = \frac{\vec{F}}{m} $$
```
3. Update velocity:
```math
$$ \vec{v}_{new} = \vec{v}_{old} + \vec{a} \Delta t $$
```
4. Update position:
```math
$$ \vec{x}_{new} = \vec{x}_{old} + \vec{v}_{new} \Delta t $$
```
Where $\Delta t$ is the time step of the simulation.