local function V(V,E)return V==V and V or E end local function E(V,E)local s=(E-V)%TAU if s>PI then s=s-TAU end return s end local function s(V,s)local t=E(V.X,s.X)local H=E(V.Y,s.Y)local Y=E(V.Z,s.Z)return V3(t,H,Y)end

local function CheckNAN(value, returnIfNan)
	return (value == value and value or returnIfNan)
end -- CheckNAN

local function DeltaAngle(current, target)
	local num = (target - current) % TAU
	if num > PI then
		num = (num - TAU)
	end
	return num
end -- DeltaAngle()

local function DeltaAngleV3(pos1, pos2)
	local x = DeltaAngle(pos1.X, pos2.X)
	local y = DeltaAngle(pos1.Y, pos2.Y)
	local z = DeltaAngle(pos1.Z, pos2.Z)
	return V3(x, y, z)
end -- DeltaAngleV3()