func (v Vector) TryNormalize() (Vector, bool) {
	m := v.Magnitude()
	if m == 0 {
		return v, false
	}
	return Vector{v.X / m, v.Y / m}, true
}
TryNormalize returns a vector that has the same direction as v, but whose length is one.
In other words, it returns a unit vector with the same direction as v.
If v has a length of zero, it will return v and false, else the described result and true.
package twodeeparticles
import (
	"errors"
	"math"
)
var (
	ZeroVector = Vector{0.0, 0.0}
	OneVector = Vector{1.0, 1.0}
)
var errNormalizeZeroVector = errors.New("normalize zero vector")
type Vector struct {
	X float64
	Y float64
}
func (v Vector) Magnitude() float64 {
	return math.Sqrt(v.X*v.X + v.Y*v.Y)
}
func (v Vector) Normalize() Vector {
	n, ok := v.TryNormalize()
	if !ok {
		panic(errNormalizeZeroVector)
	}
	return n
}