I am looking to understand the math behind creating a projectile that can curve given 3 defined points. So for example, let's say a hero is casting some spell:
So pretty much I just defined 3 points of [x1, y1], [x2, y2], [x3, y3]. It should be obvious that the projectile would start at [x1, y1] and curve towards [x2, y2] (the maxima or minima I believe?) then curve towards [x3, y3]. I'm hoping there is some mathematical formula I could use without having to use If/Then/Else.
Also, I'm not looking for any editor addons or projectile systems, I'm looking to understand the math behind this problem.
JASS:
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer( u )
local real a = GetUnitFacing( u )
local real x1 = GetUnitX( u )
local real y1 = GetUnitY( u )
local real deg = (3.14159265/180)
local real x2 = (x1 + 290 * Cos((a - 50) * deg))
local real y2 = (y1 + 290 * Sin((a - 50) * deg))
local real x3 = (x1 + 750 * Cos((a - 3) * deg))
local real y3 = (y1 + 750 * Sin((a - 3) * deg))
So pretty much I just defined 3 points of [x1, y1], [x2, y2], [x3, y3]. It should be obvious that the projectile would start at [x1, y1] and curve towards [x2, y2] (the maxima or minima I believe?) then curve towards [x3, y3]. I'm hoping there is some mathematical formula I could use without having to use If/Then/Else.
Also, I'm not looking for any editor addons or projectile systems, I'm looking to understand the math behind this problem.