From 05f0f5c20f45a04b28412e1e33f8d6fa1ee99fe2 Mon Sep 17 00:00:00 2001 From: Pierre Curto Date: Mon, 11 Oct 2021 18:35:14 +0200 Subject: [PATCH] f32: add Point.Div Signed-off-by: Pierre Curto --- f32/f32.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/f32/f32.go b/f32/f32.go index e4a7f328..54882cb1 100644 --- a/f32/f32.go +++ b/f32/f32.go @@ -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 &&