Ball flight trajectory

Hi all

I want to create a golf ball flight animation. I have all the datas and formulas I need but I’m struggling on how to animate it.

// Data of an 8 Iron shot
var startX:Number = 0;
var startY:Number = 300;
var maxHeightX:Number = 88;
var maxHeightY:Number = 26;
var landingX:Number = 143.02;
var landingY:Number = 300
var endX:Number = 145;
var endY:Number = 300;
var velocityX:Number = 17;
var velocityY:Number = -18;
var time:Number = 0;
var timeOfFlight:Number = 5.67; //in seconds
var gravity:Number = -9.8+velocityX^2;

//I would also like to add the drag effect (friction)
var friction:Number = 0.3;
//I also have some more datas that could be helpfull
var launchAngle:Number = 33
var horizontalLandingAngle:Number = -7;
var verticalLandingAngle:Number = 82;

// now here is the formula to calculate the actual x and y during the animation…
// the Z is the is the initial direction let put that value to 1 form now.
var theX:Number = velocity * cos(z) * time;
var theY:Number = velocity * sin(z) * time + (gravity/2) * t^2;

I didn’t find any GOOD exemples of what I try to achieve so far.

I need help to make the transition beetween the ascending and descending part of the anim. I’m sure that, from here it sould be quite simple, but not for me :slight_smile:

Thanks for your time