Node Physics
Physics is the natural science that studies matter and its motion and behavior through space and time and that studies the related entities of energy and force.
Installation
This is a Node.js module available through the npm registry.
Before installing nodephysics
, download and install Node.js
Installation is accomplished using the npm install command:
$ npm i nodephysics
Usage
Node Physics is a very simple package to use:
var nodephysics = require("nodephysics");
var velocity = nodephysics.velocity(20, 5, true);
console.log(velocity);
// 4 m/s
Functions
Every function has a boolean input that allows you to choose whether or not to include units. You do not have to include the boolean, if you do not want the units listed.
Below is the list of possible functions, as well as their different inputs.
- .velocity(∆ position, ∆ time, boolean)
- .acceleration(∆ velocity, ∆ time, boolean)
- .weight(mass, gravity, boolean)
- .momentum(mass, velocity, boolean)
- .power(∆ work, ∆ time, boolean)