forked from joejulian/gio
f32: add Point.Div
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
@@ -66,6 +66,11 @@ func (p Point) Mul(s float32) Point {
|
||||
return Point{X: p.X * s, Y: p.Y * s}
|
||||
}
|
||||
|
||||
// Div returns the vector p/s.
|
||||
func (p Point) Div(s float32) Point {
|
||||
return Point{X: p.X / s, Y: p.Y / s}
|
||||
}
|
||||
|
||||
// In reports whether p is in r.
|
||||
func (p Point) In(r Rectangle) bool {
|
||||
return r.Min.X <= p.X && p.X < r.Max.X &&
|
||||
|
||||
Reference in New Issue
Block a user