Interactive Physics - 2013-2014

Last semester when I was trying to develop some real-time applications for the web I ran into a problem. The problem was that there was no way for me to easily compute physics calculations on the fly on the web. There were ways for me to process physics on the backend, and do game-physics on the front-end, but there was no way to process low-level physics calculations on the front-end. Physics in this context means theoretical physics - or things like mechanics, thermal physics, quantum physics, and not things like movement within a game. 

So to combat this problem we designed a library in Javascript, specifically written for Node.JS to be able to be processed both on the front-end and the back-end. We named the library Phys.JS. It allows people to include the code-base in their front-end applications and let the calculations run client-side and on the browser rather than by the server. There are a large number of use cases for people to be able to process physics on the fly, and reduce the load that their server does.

The things we wanted to build on the web were: quick and easy simulations, teaching physics through demonstration, and just some tools that helped people in calculating these values. We are still much focused on building out a platform which allows individuals to quickly run simulations on things like n-bodies in a gravitational orbit, catapults, and measuring masses on different planets. Because we built out the framework where it takes care of the physical calculations - we can start building out tools that help the user experience rather than building them out together. Moreover, we can also build on top of the physics library and inherit it to create a special simulation library. 

The purpose of our project was to create a way for individuals to interact and build things using physics very easily. We make it fairly easy for individuals to change the accuracy of each constant, and build easy ways to interface with what the function actually does. In addition to the library, we also tested out a few new concepts like when attempting to run a function say mechanics.momentum(...), what if you made it easy to let a user get information on what a function does by simply just adding information to the beginning. So information.mechanics.moment(...) would return the parameters and the equations behind the function. This simplifies and makes it a better educational tool. Also: it also simplifies documentation as you can change documentation for both the programming and the people who are just checking it out. 

We also made it extremely easy to start using. The first example is server-side or when designing it to run locally on your machine: 

To run it on the browser easily:

Also checkout the Documentation, Examples, and Cheat Sheet if you're interested in using it. I made it with Philip Ottesen.