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 = ;var body = ; // create a new 2d bodyconsoledirbodyforce; // prints force value acting on this bodyconsoledirbodypos; // prints body's position in 2d spaceconsole; // prints 1. Bodies should have a massvar direction = ; // create a 2d vectorconsole; // prints 0, 0var spaceDirection = ; // create a 3d vectorconsole; // prints 0, 0, 0
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.