• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 11 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Advanced Physics Library designed for Javascript and Node.JS

phys.js

Build Status

Phys is a library created for individuals who want to use simple or advanced physics functions in their day-to-day work. This library includes functions for:

- Mechanics
- Thermal Physics
- Oscillations and Wave Theory
- Electric Current and Electromagnetic Induction
- Fields, Forces and Motions in Fields
- Energy, power, and climate change
- Atomic and Nuclear Physics
- Quantum Physics

The APIs will allow you to understand the usage of each function, while also being able to access each constant and each function defined in the library, and apply them in your work.

Uses

Phys is a module in node so it's pretty simple to integrate and start using with your current application. With node you're able to install the library as follows:

npm install phys

Then you're able to input it into your application directly using:

var phys = require('phys');

Now for example, if you want to use the Mechanics library you're able to just call the functions with the input numbers:

phys.mechanics.momentum(2, 3);

If you're unsure of what the momentum() function does, you're able to use a tool built into the library that will allow you understand the function before using it:

var output = phys.imechanics.momentum();
console.log(output);

Putting an "i" before any library name without parameters will allow you to see the Name, Inputs, and Equation of that particular function.

The output would be in this format:

Name:
Inputs:
Equation:

For example:

The Momentum Function
Inputs are: Mass & Velocity.
Momentum = Mass * Velocity.

You'll know the inputs you've to put in very quickly, as well as what the operations being performed behind the scenes.

This is to allow individuals to build applications that aren't just specific to calculations in Physics, but resources that would let other individuals understand Physics.

Using in Browser

Importing this into your HTML file:

<script src="phys.js"></script>
<script src="phys.min.js"></script>

Then to get values you can do:

console.log(phys.basic.changein(2, 3));

Build

To get the dependencies for our project run:

npm install

To generate the Javascript file into the /src/ run:

make build

It will compile and generate the Javascript code in: /src/phys.js & the minified file in /src/phys.min.js.

Tests

Test for the different functions in the Phys Library. To run the tests install Mocha, and then run:

make test

It will automatically test the different sections of the library, and display the results on the Terminal.

Docs

If you want to make the docs then run:

make docs

Constants

If you need extra precision in your answers feel free to alter these following files that contain the values for our precision:

  • phys/basic.js
  • phys/contants/contants.js
  • phys/constants/multiplier.js
  • phys/constants/units.js

Core Team

More Repositories

1

Tornado-Template

A starter template & server setup for Tornado, Nginx & Twitter Bootstrap when creating a new project.
CSS
29
star
2

prep

Interview prep
Python
17
star
3

go-spotify

Command-line spotify client for Mac written in Go
Go
13
star
4

usps-go

A wrapper ontop of the USPS API written in Go
Go
10
star
5

notes

Just notes of my own
TeX
8
star
6

echo-venmo

Amazon Echo Skill for Venmo. "Alexa, charge James $11".
JavaScript
6
star
7

prototyping-django

Code for a tutorial on "Prototyping using Django"
Python
6
star
8

go-rescuetime

A client to the Rescue Time API
Go
5
star
9

classes

All the coding work from my classes at NYU
Scala
5
star
10

Machine-Learning

Experiences in Machine Learning: NYU Course 480: Machine Learning & my personal experiences. Work in Perceptron Algorithm, Pegasos Algorithm & Mutli-Class Pegasos Algorithm.
Python
4
star
11

experiments

My experiments, projects, and problem sets using different languages
C++
4
star
12

context

Providing context to news articles
C++
4
star
13

compiler

Compiler Construction class at NYU
C
3
star
14

go-worker-queues

Simple worker queues in Golang (following a tutorial)
Go
3
star
15

reading

Paper/Book Review/Book/Language reading - I am trying to do one a day.
3
star
16

ClassesOnGit

Learn by looking through notes, and code created inside class
3
star
17

yelp-nlp

Analysis of the Yelp Academic Dataset
Python
3
star
18

tron

Tron implementation in Python, _incomplete_
Python
2
star
19

abhiagarwal.github.io

Personal technical blog
HTML
2
star
20

scheme-in-haskell

Implementing Scheme in Haskell, still *in progress*
Haskell
2
star
21

dubsit

Giving search engines a new twist
JavaScript
2
star
22

codeblog

Technical blog repository
Makefile
2
star
23

HackDays

Summary of the events that go on at Tech@NYU's HackDays
Python
2
star
24

albert

Albert API - Deprecated
Go
2
star
25

rfid-foursquare

Using a RFID scanner to checkin to the location on Foursquare
C
1
star
26

dynamo.js

Quick implementation of my ideal framework
JavaScript
1
star
27

go-sample-api

Sample abstract RESTful api written in Go
Go
1
star
28

Timetable-Management-System

Program written in Java to manage students timetables in accordance to their break schedueles.
Java
1
star
29

torch-experiments

Fun experiments using Torch
Lua
1
star
30

noodle-map

Map of my food tastes created using StoryMapJS
HTML
1
star
31

face

Experimentation on facial recognition/detection in Python
Python
1
star
32

Knowledge-Map

Knowledge Map is a project that will allow me to store my learnings from Quora and Wikipedia.
Ruby
1
star
33

bank-analysis

Mac app for analysis of my personal spending, _incomplete_. Use electron & plaid later.
JavaScript
1
star
34

onetime-url

A simple onetime URL generator
Go
1
star
35

cities

1
star
36

Time-Threads

HackNY Hackathon - an unfinished web tool where you take a news article, and it gives you the all the previous articles on the same issue.
Python
1
star
37

football

Some scraping then data analysis on Fifa World Cup
Python
1
star
38

District

Device to help you understand the area you enter
JavaScript
1
star
39

django-template

Quick to use django template. Repository will tend towards adapting best practices.
Python
1
star
40

geospatial-indexing

Experimenting with geospatial indexing (unfinished)
C++
1
star
41

analog-learning

Python
1
star
42

dotfiles

Keep moving between computers so all my dotfiles!
Shell
1
star
43

Bridge

Old Bridge Project at NYU - old PHP days..
PHP
1
star
44

abhi.co

Portfolio website
HTML
1
star
45

go

Presenting Go
Go
1
star
46

gallatin

NYU Gallatin -> Will eventually lead to my thesis & rationale
TeX
1
star
47

articlediff

Git diff but for articles across the interwebs
Go
1
star
48

v8

Just playing around with the V8
C++
1
star