diff --git a/geometry.go b/geometry.go index 5f16ba4..6642b66 100644 --- a/geometry.go +++ b/geometry.go @@ -84,6 +84,14 @@ func (u Vec) Sub(v Vec) Vec { } } +// Floor returns converts x and y to their integer equivalents. +func (u Vec) Floor(v Vec) Vec { + return Vec{ + math.Floor(u.X), + math.Floor(u.Y), + } +} + // To returns the vector from u to v. Equivalent to v.Sub(u). func (u Vec) To(v Vec) Vec { return Vec{