From 51cd0314d5340540eff060ed57236d3ff4108084 Mon Sep 17 00:00:00 2001 From: faiface Date: Sun, 11 Jun 2017 01:17:37 +0200 Subject: [PATCH] minor doc changes --- geometry.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/geometry.go b/geometry.go index 02a8b51..d1819a8 100644 --- a/geometry.go +++ b/geometry.go @@ -49,11 +49,6 @@ func (u Vec) XY() (x, y float64) { return u.X, u.Y } -// Normal returns a vector normal to u (rotated by math.pi/2) -func (u Vec) Normal() Vec { - return Vec{X: u.Y, Y: -u.X} -} - // Add returns the sum of vectors u and v. func (u Vec) Add(v Vec) Vec { return Vec{ @@ -70,7 +65,7 @@ func (u Vec) Sub(v Vec) Vec { } } -// To returns the vector from vector u to vector 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 { return Vec{ v.X - u.X, @@ -115,6 +110,11 @@ func (u Vec) Rotated(angle float64) Vec { } } +// Normal returns a vector normal to u. Equivalent to u.Rotated(math.Pi / 2). +func (u Vec) Normal() Vec { + return Vec{X: u.Y, Y: -u.X} +} + // Dot returns the dot product of vectors u and v. func (u Vec) Dot(v Vec) float64 { return u.X*v.X + u.Y*v.Y