From 49c306fcbe37539c9390399f4bebb42136fb754c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20D=C3=B3ka?= Date: Wed, 4 Nov 2020 21:34:42 +0100 Subject: [PATCH] cleaning angle to function --- geometry.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/geometry.go b/geometry.go index bac34d2..97f4df8 100644 --- a/geometry.go +++ b/geometry.go @@ -189,8 +189,7 @@ func (u Vec) Project(v Vec) Vec { // AngleTo returns angle between u and v. func (u Vec) AngleTo(v Vec) float64 { - u, v = u.Unit(), v.Unit() - return math.Cos(u.Dot(v)) + return math.Cos(u.Unit().Dot(v.Unit())) } // Map applies the function f to both x and y components of the vector u and returns the modified