local U={}function U.ClampMagnitude(U,o)return U.Magnitude>o and U.Unit*o or U end function U.AngleBetween(U,o)return math.acos(math.clamp(U.Unit:Dot(o.Unit),-1,1))end function U.AngleBetweenSigned(o,N,q)local R=U.AngleBetween(o,N)return R*math.sign(q:Dot(o:Cross(N)))end return U



local VectorUtil = {}


function VectorUtil.ClampMagnitude(vector, maxMagnitude)
	return (vector.Magnitude > maxMagnitude and (vector.Unit * maxMagnitude) or vector)
end


function VectorUtil.AngleBetween(vector1, vector2)
	return math.acos(math.clamp(vector1.Unit:Dot(vector2.Unit), -1, 1))
end


function VectorUtil.AngleBetweenSigned(vector1, vector2, axisVector)
	local angle = VectorUtil.AngleBetween(vector1, vector2)
	return angle * math.sign(axisVector:Dot(vector1:Cross(vector2)))
end


return VectorUtil
