Formula/method for "predicted" 2D parabola path?

Hi all,
I'm attempting to write a simple loop routine to graph/chart out a "predicted" parabolic bath of a simple moving object, i.e. a ball launched from a cannon. I've found countless math formulas online, and I've come somewhat close to getting an accurate path, but everything seems just a bit "off" no matter what numbers I plug in.

The moving object in question is under standard real world physics. Density of 1.0 (so no multiplier), gravity of 9.8m/s^2, no air friction, no linear damping, etc. What I need is a formula where I can say:

"With given position X (unaffected by gravity obviously, and no other horizontal acceleration), provide me the vertical Y offset (from starting position) with standard gravity of 9.8 factored in".

The X positions would be just iterations in a loop, like every 20 pixels in the horizontal direction, it would plot a dot at the X/Y position, thus forming a visual path which the ball, when launched, will follow. There would also, of course, be an initial Y velocity (negative) if the ball was launched at an upward angle... so the equation needs to have this factor included for various trajectory angles.

What's really confusing me is how "meters" (as in the gravity formula) translate into "pixels" in the Corona world space. The documentation states that for simple linear velocities (i.e. object:setLinearVelocity(x,y)), the X and Y values are "pixels per second". But for gravity, I can't even guess how the standard Earth gravity of 9.8m/s^2 translates into Corona world space.

Any help from math/physics gurus would be SO appreciated at this point! I'm about 2 hours into this and I'm tearing out my hair. It's probably easier than I think, actually... most likely I have overcomplicated it with too much number crunching. :)

Thanks,
Brent

P.S. - My idea of firing an invisible "ghost" object in the same path, prior to launching the real object, and mapping dots as it flies along... well I suppose that is possible but not preferable, because it would take more time in the game scope. I would much prefer a mathematical method which can instantly (or very quickly) graph out the parabolic path.

views:1543 update:2011/12/29 9:44:01
corona forums © 2003-2011