Documentation ¶
Overview ¶
2D vectors lib
Index ¶
- Constants
- func Dir(v V2) float64
- func Len(a V2) float64
- func LenSqr(a V2) float64
- type V2
- func Add(a, b V2) V2
- func AddMul(a, b V2, t float64) V2
- func ApplyOnTransform(V, pos V2, angle float64) V2
- func InDir(angle float64) V2
- func Mul(a V2, t float64) V2
- func MulXY(a V2, b V2) V2
- func Normed(a V2) V2
- func RandomInCircle(R float64) V2
- func RandomOrt() V2
- func Rotate(V V2, angle float64) V2
- func Rotate90(a V2) V2
- func Sub(a, b V2) V2
- func (a V2) Add(b V2) V2
- func (a V2) AddMul(b V2, t float64) V2
- func (v V2) ApplyOnTransform(pos V2, angle float64) V2
- func (a V2) Dir() float64
- func (a *V2) DoAddMul(b V2, t float64)
- func (a *V2) DoNorm()
- func (a V2) Len() float64
- func (a V2) LenSqr() float64
- func (a V2) Mul(t float64) V2
- func (a V2) MulXY(b V2) V2
- func (a V2) Normed() V2
- func (a V2) Rotate(angle float64) V2
- func (a V2) Rotate90() V2
- func (a V2) Sub(b V2) V2
Constants ¶
View Source
const Deg2Rad = math.Pi / 180
View Source
const Rad2Deg = 180 / math.Pi
Variables ¶
This section is empty.
Functions ¶
Types ¶
type V2 ¶
float64 vector2
var ZV V2
zero vector
func ApplyOnTransform ¶
ApplyOnTransform translate vector V moving by pos and turning by angle degrees
func InDir ¶
InDir return an ort vector in direction of angle degrees 0 angle is up (0,1), positive direction is counterclockwise for world coords primary, use for screen coords with caution (because of Y axis)
func RandomInCircle ¶
RandomInCircle returns a random vector in circle with radius R
Click to show internal directories.
Click to hide internal directories.