Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 

Repository files navigation

💥 Elastic Collision Simulation Project

📘 Table of Contents

  • 🎨 Visual of Simulation
  • 🔥 Features in Simulation
  • 📝 Physics Concepts in Simulation
  • 🛠️ How it Works
  • 🎯 Requirements
  • 💻 How to Run
  • 📹 Video Details for Simulation

🎬 Short Clip of Simulation

Walkthrough.Video.-.Elastic.Collision.Simulation.Project.mp4

🎨 Visual of Simulation

image

🔥 Features in Simulation

  • Real time animation using a timer.
  • 2D representation of collisions between balls.
  • Final velocity is determined from derived momentum equation.
  • Includes live velocity tracker from motion.
  • Implementation of wall collision detection.
  • Usage of rectangle object are enhanced for contact between balls.

📝 Physics Concepts in Simulation

  • Conversation of Momentum (p): m1i + m2i = m1f + m2f.
  • Elastic Collisions.

🛠️ How it Works

  • Initializes frame, final velocity, horizontal position, ball height properties for simulation modelling.
  • Velocities are in same magnitude, but opposite in direction when making contact with the walls.
  • Has animation with the use of Java Timer.
  • Includes paint method that draws the balls in their updated positions.
  • Velocity table of values is being displayed by classic print lines.
  • Conditionals are implemented to check if balls are intersecting one another and used to change the value of the velocity using the derived momentum equations.
  • Position of the balls are being updated from constant velocity variables declared.

🎯 Requirements

  • Java (JDK or higher).
  • IDE (e.g., VS Code, Eclipse, or IntelliJ).

💻 How to Run

  1. Copy the code into a Java file named "ElasticCollision.java".
  2. Compile the program: "javac ElasticCollision.java".
  3. Run the program: "java ElasticCollision".

📹 Video Details for Simulation

I plan to make a YouTube video that will showcase the history behind elastic collisions, more deep explanation of how I programmed the project, and share general physics knowledge relating to the topic. This video will help give me a reflection on what I learned and for others who are interested in this particular subject and simulation :D.

Video Link of Simulating a Elastic Collision in Java (YouTube) - [Coming Soon!].

About

The project demonstrates conservation of momentum between three balls, respective with their own mass, speed, x-position, and y-position. Using derived Physics equations I determined the magnitude and direction for the final velocity for each ball when they make contact. As a result, this provides the ball with it's new updated position.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages