Skip to content

Instantly share code, notes, and snippets.

@ElectricImpSampleCode
Last active November 26, 2019 11:46
Squirrel math atan2() example
local oppositeSide = 3.0;
local adjacentSide = 4.0;
local angleInRadians = math.atan2(adjacentSide, oppositeSide);
local angleInRegrees = (angleInRadians * 180) / PI;
if (angleInRegrees > 20) {
server.log("Warning! Unstable!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment