Projectile Motion using Java 2D API
Hi, i just want to share about my little project about implementation of Java 2D API, i think this API is powerful to custom Swing component and write an animation program. You just simply overiding paintComponent method at JPanel class and let your creativity play. In my apps, i make my own library that contain custom Swing component. That components is eye catching, and with that i can use in my future java desktop project.
Combine with TimingFramework and javax.swing.timer i make an apps that contain animation to simulate an amazing of physics science, in my chase is Projectile Motion, this motion dependent on 2 variable, there are Veloctiy and Elevation angle. With remember of physics subject at high school where :
- VOx = VO * cos θ° dan VOy = VO * sin θ°
- VO = VOxi + VOyj
- x = Vox*t dan y = Voy*t – 1/2*g*t2
- y = tan(θ)*x – 1/2*g*(x/Vocos θ)2
- H = Voy2 / 2g
- R = Vo2sin(2θ)/ g
- zsa zsi zsu :mrgreen:
i make an apps :) like picture below :
with creativity, JAVA and 6 six of projectile motion recipes i finished that apps. This is the theory of projectile motion.
The parabolic path of a projectile that leaves the origin with a velocity vi . The velocity vector v changes with time in both magnitude and direction. This change is the result of acceleration in the negative y direction. The x component of velocity remains constant in time because there is no acceleration along the horizontal direction. The y component of velocity is zero at the peak of the path.
The projectile motion terms :
- The distance is small enough so that the curvature of the earth can be neglected.
- The height is small enough gravity to elevation changes in velocity can be ignored.
Ok that’s my little apps to simulate a projectile motion, but unfortunatelly this apps only have an Indonesian translation and has no i18n, sorry. But i hope my post help you to know about the great abilty of JAVA 2D API :mrgreen:
YOU CAN DOWNLOAD HERE and dont forget to comment my post :)