return x * math.sqrt(1 + t * t)
end
+--------------------------------------------------------------------------------
+function math.sign(x, tolerance)
+ tolerance = tolerance or 0
+ if x > tolerance then
+ return 1
+ elseif x < -tolerance then
+ return -1
+ end
+ return 0
+end
+
--------------------------------------------------------------------------------
function get_last_folder(text,count)
local parts = text:split(DIR_DELIM)
vector.length(v) -> number
vector.normalize(v) -> vector
vector.round(v) -> vector
+vector.apply(v, func) -> vector
vector.equals(v1, v2) -> bool
For the following functions x can be either a vector or a number.
vector.add(v, x) -> vector
math.hypot(x, y)
^ Get the hypotenuse of a triangle with legs x and y.
Useful for distance calculation.
+math.sign(x, tolerance)
+^ Get the sign of a number
+ Optional: Also returns 0 when the absolute value is within the tolerance (default 0)
string:split(separator)
^ e.g. string:split("a,b", ",") == {"a","b"}
string:trim()