HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Parabola problem

07-22-2009, 08:15 PM#1
Wizardum
So I took moyack's parabola formula
Collapse JASS:
function ParabolicMovement takes real h, real d, real x returns real
    local real a = -4*h/(d*d)
    local real b = 4*h/d
    return a*x*x + b*x
endfunction

but since I'm not that good with math, what value should be the x? is it supposed to be a value which updates inside a loop? I really don't know because he mentioned the value should not be lesser than zero and not be greater than the distance.

Thanks in advance!
07-22-2009, 08:50 PM#2
Anitarf
Perhaps this will help. The value that the function returns is basically the y value of the graph of a parabolic equation at the given x coordinate.
07-22-2009, 08:56 PM#3
Hans_Maulwurf
d should be the max distance (the distance between the starting and landing point), h the max height (the top of the parabola) and x the current position of the unit.

so if you want to move sth in a parabola you need to do sth like this in a loop
Collapse JASS:
dist = dist + speed
x = startx + (dist * Cos(angle))
y = starty + (dist * Sin(angle))
z = ParabolicMovement( maxheight, maxdist, dist)
07-22-2009, 08:58 PM#4
Wizardum
ah now I understand.
Thank you both
cookies
07-23-2009, 01:08 PM#5
Idontneedaname
Creating the parabola with a given maximum height is badass. If you can't find a script but want to create the parabola this way, drop me a message.