func (v *Vector) Project(nv *Vector) *Vector {
	b := nv.Copy()
	len := b.Dot(v) / v.Len()
	return v.Unit().Scaled(len)
}
Project returns a projection (or component) of vector u in the direction of vector v.

Behaviour is undefined if v is a zero vector.
package common
import (
	"fmt"
	"image"
	"math"
)
var ZV = &Vector{0, 0}
type Vector struct {
	X, Y float64
}
func Vect(x, y float64) Vector {
	return Vector{X: x, Y: y}
}
func (v *Vector) Copy() *Vector {
	return &Vector{X: v.X, Y: v.Y}
}
func NewVectorFromPoint(point image.Point) *Vector {
	return &Vector{X: float64(point.X), Y: float64(point.Y)}
}
func (v *Vector) String() string {
	return fmt.Sprintf("Vector(%v, %v)", v.X, v.Y)
}
func (v *Vector) XY() (x, y float64) {
	return v.X, v.Y
}
func (v *Vector) Add(nv *Vector) *Vector {
	b := nv.Copy()
	v.X += b.X
	v.Y += b.Y
	return v
}
func (v *Vector) Sub(nv *Vector) *Vector {
	b := nv.Copy()
	v.X -= b.X
	v.Y -= b.Y
	return v
}
func (v *Vector) Scaled(s float64) *Vector {
	v.X *= s
	v.Y *= s
	return v
}
func (v *Vector) ScaledXY(nv *Vector) *Vector {
	b := nv.Copy()
	v.X *= b.X
	v.Y *= b.Y
	return v
}
func (v *Vector) Len() float64 {
	return math.Hypot(v.X, v.Y)
}
func (v *Vector) Angle() float64 {
	return math.Atan2(v.Y, v.X)
}
func Unit(angle float64) *Vector {
	v := &Vector{1, 0}
	return v.Rotated(angle)
}
func (v *Vector) Unit() *Vector {
	if v.X == 0 && v.Y == 0 {
		v.X = 1
		v.Y = 0
		return v
	}
	return v.Scaled(1 / v.Len())
}
func (v *Vector) Rotated(angle float64) *Vector {
	sin, cos := math.Sincos(angle)
	v.X *= cos - v.Y*sin
	v.Y *= sin + v.Y*cos
	return v
}
func (v *Vector) Normal() *Vector {
	v.Y = -v.Y
	return v
}
func (v *Vector) Dot(nv *Vector) float64 {
	b := nv.Copy()
	return v.X*b.X + v.Y*b.Y
}
func (v *Vector) Cross(nv *Vector) float64 {
	b := nv.Copy()
	return b.X*v.Y - v.X*b.Y
}