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
}
Rotated returns the vector u rotated by the given angle in radians.
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())
}