Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```