VE Lua Documentation

Press F to search!

conicBezier

Definition


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

-- it can represent segments of any conic section: hyperbolas, parabolas, ellipses, and circles
function conicBezier(p1, p2, p3, t, w)
  w = w or 1
  local t1 = 1-t
  local t1t1, wtt12, tt = t1*t1, 2*w*t*t1, t*t
  local d = 1/(t1t1 + wtt12 + tt)
  return t1t1*d*p1 + wtt12*d*p2 + tt*d*p3
end

Callers