# Parabola problem

**URL:** <https://forum.kirupa.com/t/parabola-problem/279230>\
**Category:** Uncategorized\
**Created:** [January 12, 2009, 3:11am UTC](https://forum.kirupa.com/t/parabola-problem/279230 "2009-01-12T03:11:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OMG](https://avatars.discourse-cdn.com/v4/letter/o/9dc877/32.png) [@OMG](https://forum.kirupa.com/u/OMG)\
**Post date:** [January 12, 2009, 3:11am UTC](https://forum.kirupa.com/t/parabola-problem/279230/1 "2009-01-12T03:11:03Z")

</div>

Hi again, I’ve been inactive for over 2 years (I’ve been very busy, I program for fun), and just now I needed to test something in flash and like I thought I screwed up, plz help \>\_\<

this is an engine that makes the ball move in a curved line. On paper with small x and y values it looks ok but when it’s on flash (500 x 400) the curve looks ridiculous \>.\>

[AS]  
//ball’s initial positions  
var initX:Number=30;  
var initY:Number=350;  
//initial x + goX = final x position, the motion stops when reached  
//initial y + goY = highest point  
var goX:Number=200;  
var goY:Number=100;  
//some numbers I need to know to find the equation of the parabola  
var h:Number;  
var k:Number;  
var a:Number;  
//y=a(x-h)^2+k  
//see next comment  
function doParabola(distX:Number, distY:Number):void {  
h=initX+distX/2;  
k=initY-distY;  
//a=(y-k)/(x-h)^2  
a=((initY-k)/(initX-h)_(initX-h));  
}  
doParabola(200, 70);  
addEventListener(Event.ENTER\_FRAME,moveBall);  
function moveBall(e:Event):void {  
ball1.x++;  
ball1.y=a_(ball1.x-h)\*(ball1.x-h)+k;

trace(ball1.x,ball1.y);  
//stops the ball  
if (ball1.x\>=initX+goX) {  
trace(“stop”);  
removeEventListener(Event.ENTER\_FRAME,moveBall);  
}  
}  
//  
var ball1:ball=new ball();  
addChild(ball1);  
ball1.x=initX;  
ball1.y=initY;  
[/AS]  
(ROFL I guessed the tags for actionscript code)

isn’t the ball supposed to move 200 pixels in length and 70 in height…sry I suck at math x.x  
(I think the problem has something to do with flash’s inversed y)
