Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wagerfield/nd-physics
Dimension Agnostic Physics Engine
https://github.com/wagerfield/nd-physics
Last synced: about 2 months ago
JSON representation
Dimension Agnostic Physics Engine
- Host: GitHub
- URL: https://github.com/wagerfield/nd-physics
- Owner: wagerfield
- License: mit
- Created: 2014-03-19T19:47:25.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-03-30T22:24:12.000Z (over 4 years ago)
- Last Synced: 2024-04-14T05:17:04.199Z (9 months ago)
- Language: JavaScript
- Size: 195 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nD Physics
> Dimension Agnostic Physics Engine
[![Build Status](https://travis-ci.org/wagerfield/nd-physics.svg?branch=master)](https://travis-ci.org/wagerfield/nd-physics)
## Integrators
#### Newton's Law of Motion
```
force = mass * acceleration
acceleration = force / mass
acceleration = force * (1 / mass)
acceleration = force * inverseMass
```#### Euler
```
v = v + a * dt
x = x + v * dt
```#### Improved Euler
```
x = x + v * dt + a * dt * dt * 0.5
v = v + a * dt
```#### Verlet
```
xi+1 = xi + (xi - xi-1) + a * dt * dt
```#### Time Corrected Verlet
```
xi+1 = xi + (xi - xi-1) * (dti / dti-1) + a * dti * dti
```