GE Lua Documentation

Press F to search!

biQuadratic

Definition


-- @/lua/common/mathlib.lua:1329

-- does not pass through points, smooths the signal
function biQuadratic(p0, p1, p2, p3, t)
  local p12 =  p1 + (p2 - p1) * (t * 0.5 + 0.25)
  if t <= 0.5 then
    local p01 = p0 + (p1 - p0) * (t * 0.5 + 0.75)
    return p01 + (p12 - p01) * (t + 0.5)
  else
    return p12 + (p2 + (p3 - p2) * (t * 0.5 - 0.25) - p12) * (t - 0.5)
  end
end

Callers