local function U(U,A,o,K,B,x)K,B,x=default(K,B,x)if U==0 then return K end U=U/x if U==1 then return K+B end if not o then o=x*.3 end local S if not A or A<abs(B)then A=B S=o/4 else S=(o/(2*pi))*asin(B/A)end return((A*pow(2,-10*U))*sin(((U*x-S)*(2*pi))/o)+B)+K end
-- a: amplitud
-- p: period
local function outElastic(t, a, p, b, c, d)
	b, c, d = default(b, c, d)
	if t == 0 then
		return b
	end

	t = t / d

	if t == 1 then
		return b + c
	end

	if not p then
		p = d * 0.3
	end

	local s

	if not a or a < abs(c) then
		a = c
		s = p / 4
	else
		s = p / (2 * pi) * asin(c / a)
	end

	return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b
end
