Little refactoring

This commit is contained in:
Alexey 2025-06-25 14:01:04 +03:00
commit 8a8db93ac1
7 changed files with 67 additions and 53 deletions

View file

@ -29,3 +29,14 @@ end
function Point:coords()
return self.x, self.y
end
-- Return vector length between points
---@param point Point
---@return number
function Point:distanceTo( point )
return math.sqrt(
( self.x - point.x ) ^ 2 +
( self.y - point.y ) ^ 2
)
end