• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Parabola/Arc Equation

Status
Not open for further replies.
Level 10
Joined
Jun 6, 2007
Messages
392
I don't know what exactly you are looking for, but this is a function I made to use in my spells which require some parabola. It takes dist, which is the (x)distance between roots, height which is the max height of the parabola, and x value, and returns z value.

If you use this function for a missile, just give it the distance that the missile has travelled as x-value, and set the height of a missile to return value.

JASS:
function Parabola takes real dist, real height, real x returns real
    local real a = 4*height/dist
    return a*x*(-x/(dist)+1)
endfunction
 
Status
Not open for further replies.
Top