Files
opus-apps/neural/apis/angle.lua
kepler155c@gmail.com a0a92818d6 neural look
2019-03-13 17:53:49 -04:00

12 lines
232 B
Lua

local Angle = { }
function Angle.towards(x, y, z)
return math.deg(math.atan2(-x, z)), math.deg(-math.atan2(y, math.sqrt(x * x + z * z)))
end
function Angle.away(x, y, z)
return math.deg(math.atan2(x, -z)), 0
end
return Angle