package math import ( stdmath "math" ) type Direction float64 func (d *Direction) Set(v float64) { *d = Direction(v) } func (d Direction) Get() float64 { return float64(d) } func (d Direction) ForwardVector() Vec2f { return Vec2f{ X: stdmath.Cos(float64(d)), Y: stdmath.Sin(float64(d)), } } func (d *Direction) Rotate(delta float64) { *d += Direction(delta) }