cleaning angle to function

This commit is contained in:
Jakub Dóka 2020-11-04 21:34:42 +01:00
parent 380d77f63e
commit 49c306fcbe
1 changed files with 1 additions and 2 deletions

View File

@ -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