Adding a pixel.Vec Floor method to geometry.go
This commit is contained in:
parent
ee54171247
commit
d3f6331240
|
@ -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).
|
// To returns the vector from u to v. Equivalent to v.Sub(u).
|
||||||
func (u Vec) To(v Vec) Vec {
|
func (u Vec) To(v Vec) Vec {
|
||||||
return Vec{
|
return Vec{
|
||||||
|
|
Loading…
Reference in New Issue