ngraph.physics.primitives
Module with basic 2d and 3d physics primitives for ngraph. It defines interface for physical bodies, used in n-body simulation.
Examples
var physics = requrie('ngraph.physics.primitives');
var body = new physics.Body();
console.dir(body.force);
console.dir(body.pos);
console.log(body.mass);
var direction = new physics.Vector2d();
console.log(direction.x, direction.y);
var spaceDirection = new physics.Vector3d();
console.log(spaceDirection.x, spaceDirection.y, spaceDirection.z);
Install
npm install ngraph.physics.primitives
Why?
I created this module to declare clear interface for expected bodies in N-Body force simulation. You don't have to use it, as long as your body
object have the same properties as described here.