URL | Description |
---|---|
Does anybody have a simple ballistic trajectory algorithm I can use? | First, "power" is not appropriate in this situation. I think a better parameter is "kinetic energy". A gun can give a projectile a fixed amount of kinetic energy, so heavier projectiles will travel more slowly than lighter projectiles. The formula for kinetic energy is E = ms2/2, so the initial speed is this: s0 = sqrt( 2E/m ) m is the weight (actually mass) of the projectile Next, the initial direction of travel, given an angle, is this: D0 = [ cos(angle), sin(angle) ] Now with the initial speed and initial direction, you have the initial velocity vector: V0 = s * D0 = [ s*cos(angle), s*sin(angle) ] Finally, ignoring wind and air resistance, the position of the projectile at any time is given by this formula: P = P0 + V0t + Agt2/2 P0 is the initial position Ag is acceleration due to gravity [0, -9.8 ] Now, dealing with air resistance and wind makes this much more complicated (if done accurately). You can simplify things by ignoring air resistance and treating wind as horizontal force. Since, f = ma, and thus a = f/m, you can treat wind as a simple acceleration that is included in the equation. The acceleration due to wind is this: Aw = [ fw/m, 0 ] The final equation looks like this: P = P0 + V0t + (Ag + Aw)t2/2 So, given the energy of the gun (E), the position of the gun (P0), the angle of the gun (angle), the mass of the projectile (m), and the force of the wind (fw), you can calculate the position of the projectile with the above equation. |
Kinematics | |
Kinematics and Calculus | |
Trajectory of a Projectile | Elementary equations of motion given inital velocy v, and angle of cannon.x = v * t * cos(θ) y = v * t * sin(θ) - 1/2 g * t2 where g = -9.8 θ = angle of launch v = initial velocity t = time in seconds Angle theta required to hit coordinate (x,y) |
What are the kinematic formulas? |