This project is for demonstration of Coefficient of Restitution. You can input height and Coefficient of Restitution and watch the simulation. Also project can print 10 height after bounce for your analysis.
Coefficient of Restitution: The ratio of final velocity to the initial velocity between two objects after their collision is known as the coefficient of restitution. The restitution coefficient is denoted as ‘e’ and is a unitless quantity, and its values range between 0 and 1 (inclusive).
Formula:
e = coefficient of restitution
v = velocity after bounce
u = velocity before bounce
h2 = maximum heigth after bounce
h1 = height from ball dropped
/
|-- CoefficientofRestitutionAnalysis/
|-- bin/
|-- application/ #Contains project class files
|-- images/ #Contains images used in the project
|-- src/
|-- application/
|-- ball.java #Contains methods applied on ball
|-- main.java #For initialization of screen and app
|-- SampleController.java #Controles motion of ball and set values
|-- Sample.fxml #Contains User Interface code (FXML)
|-- images/ #Contains images used in the project
-
Clone this repository in your local system.
-
Download Eclipse IDE and setup Java Language in your machine.
-
Download Java FXML, SceneBuilder and JPheonix
Java FXML Download Link
SceneBuilder DownLoad Link
JPheonix Download Link -
Open Eclipse and open CoefficientofRestitutionAnalysis folder as project.
-
Go to
Windows -> Preference
. -
Search User Libraries and click New and name JavaFX.
-
Search JavaFX and paste Scene Builder executable file path and JavaFX bin folder path in respective field.
-
Go to
Run -> Run Configuration
. -
Move to Java Application and select Main and then Argument.
-
In VM arguments paste below code:
--module-path "<Enter path to JavaFX/lib folder>" --add-modules javafx.controls,javafx.fxml
-
Click apply.
-
Right click on Project Name and in Build Path select Configure Build Path search for Java Build Path.
-
Click on Classpath, remove JavaFX and JPheonix already present in that, and from right select Add Library.. then click on User Library, select next and check JavaFX.
-
Drag JavaFX SDK from Modulepath to Classpath.
-
Click on Classpath and from right select Add External JARs.. and select JPheonix JAR file from your machine.
-
Click on Apply and close.
-
Project is now successfully setup in your machine 😎.