starlit  Diff

Differences From Artifact [54a7601a0f]:

To Artifact [3edc02f291]:


69
70
71
72
73
74
75








76
77
78
79
80
81
82
		end
	end

	return string.format("%s%s", val, unit)
end

function fn.lerp(t, a, b) return (1-t)*a + t*b end









function fn.trim(fl, prec)
	local fac = 10^prec
	return math.floor(fl * fac) / fac
end

function fn.sign(v)







>
>
>
>
>
>
>
>







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
		end
	end

	return string.format("%s%s", val, unit)
end

function fn.lerp(t, a, b) return (1-t)*a + t*b end
function fn.gradient(grad, pos)
	local n = #grad
	if n == 1 then return grad[1] end
	local op = pos*(n-1)
	local idx = math.floor(op)
	local t = op-idx
	return fn.lerp(t, grad[1 + idx], grad[2 + idx])
end

function fn.trim(fl, prec)
	local fac = 10^prec
	return math.floor(fl * fac) / fac
end

function fn.sign(v)