Skip to content
Snippets Groups Projects
Commit 1de2dbe5 authored by faiface's avatar faiface
Browse files

fix Vec.Normal to rotate by pi/2, not -pi/2

parent 9eaf82e0
No related branches found
No related tags found
No related merge requests found
...@@ -112,7 +112,7 @@ func (u Vec) Rotated(angle float64) Vec { ...@@ -112,7 +112,7 @@ func (u Vec) Rotated(angle float64) Vec {
// Normal returns a vector normal to u. Equivalent to u.Rotated(math.Pi / 2), but faster. // Normal returns a vector normal to u. Equivalent to u.Rotated(math.Pi / 2), but faster.
func (u Vec) Normal() Vec { func (u Vec) Normal() Vec {
return Vec{u.Y, -u.X} return Vec{-u.Y, u.X}
} }
// Dot returns the dot product of vectors u and v. // Dot returns the dot product of vectors u and v.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment