on square (x)
return x*x
end
on asin (x)
res = atan(sqrt(x*x/(1-x*x)))
if x<0 then res = -res
return res
on acos (x)
return PI/2 - asin(x)