need help with programming an Arc

caermundh

New member
Joined
Nov 18, 2010
Messages
1
Hello! I hope i am posting this in the right forum.

I am a programmer who is currently programming a medieval style game. I am trying to find the math formula to calculate the arc of a rock as it leaves a catapult.

I have no idea where to begin with this. Can someone help me out here?

Thank you in advance for your time.
 
Generally, ignoring air resistance, one might use a simple parametric definition.

You must have:
Release Angle of Catapult, compared to the horizontal. I'll use 30 degrees.
Releast point of the Catapult. I'll use 15 ft off the ground.
Initial Velocity of the Projectile. I'll use 200 ft / second
t is time in seconds.

The horizontal part is easiest. x(t) = (200 ft / sec) * cos(30 deg) * t

The vertical part is a bit trickier, since it's probably a good idea to include gravity. g = -32 ft / sec^2
This gives: y(t) = -32 ft / sec^2 t^2 + (200 ft/sec)*sin(30 deg)*t + 15 ft

Conversion to metric is not difficult.

Including air resistance is quite a bit trickier, but not terminal. Without it, if you try to build a real device, you will not get the distance you predict.

Another assumption is often that the world is flat. Other terrains will present additional complications.

One more. Most catapults are not all that consistent. The size and weight of the projectile and the flexibility of the catapult structure will have something to do with the initial velocity. Generally, bigger is slower.

I think what I mean, here, is that you can make it as complicated or simplified as you like.
 
Top