make angle methods consistent on vectors

This commit is contained in:
Jill 2022-09-23 08:34:23 +03:00
parent 6c5ad34536
commit fdc15e1fd8
1 changed files with 3 additions and 2 deletions

View File

@ -23,9 +23,9 @@ function vect:lengthSquared()
return self.x * self.x + self.y * self.y
end
---@return number
---@return number @angle in degrees
function vect:angle()
return math.atan2(self.y, self.x)
return math.deg(math.atan2(self.y, self.x))
end
---@return vector2D
@ -44,6 +44,7 @@ function vect:resize(x)
return vector2D(n.x * x, n.y * x)
end
---@param ang number @angle in degrees
---@return vector2D
function vect:rotate(ang)
local a = self:angle()