Skip to content

Simple simulator that accounts for gravity and collisions. The location you click will be where a ball is spawned, the distance you drag it will determine the magnitude of its velocity, the direction you drag it will determine the direction, and finally the length of time you hold it will determine its size/mass.

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Gravity-Collision-Simulator

A simple implementation of a two dimensional collision simulator using javax.swing. The location you click will be where a ball is spawned, the distance you drag it will determine the magnitude of its velocity, the direction you drag it will determine the direction, and finally the length of time you hold it will determine its size/mass.

You can adjust the coefficient of resistitution, frames per second, the acceleration of gravity, and the path size.

The physics equations used afre those you would typically find in a twelfth grade physics class.

Finally, balls can be created within other balls and the program will adjust so that there is no overlap.

About

Simple simulator that accounts for gravity and collisions. The location you click will be where a ball is spawned, the distance you drag it will determine the magnitude of its velocity, the direction you drag it will determine the direction, and finally the length of time you hold it will determine its size/mass.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages