Documentation
¶
Index ¶
- type Vec
- func Add(v, u *Vec) *Vec
- func Divide(v *Vec, div float64) *Vec
- func Multiply(v *Vec, mul float64) *Vec
- func New(x, y float64) *Vec
- func Normalize(v *Vec) *Vec
- func Project(v, u *Vec) *Vec
- func Rotate(v *Vec, angle float64) *Vec
- func Subtract(v, u *Vec) *Vec
- func Unit(angle float64) *Vec
- func Zero() *Vec
- func (v *Vec) Add(u *Vec)
- func (v Vec) Angle() float64
- func (v *Vec) Cap(max float64)
- func (v Vec) Cross(u *Vec) float64
- func (v *Vec) Divide(div float64)
- func (v Vec) Dot(u *Vec) float64
- func (v *Vec) Magnitude() float64
- func (v *Vec) Multiply(mul float64)
- func (v *Vec) Normalize()
- func (v *Vec) Project(u *Vec)
- func (v *Vec) Rotate(angle float64)
- func (v *Vec) SetMagnitude(l float64)
- func (v *Vec) String() string
- func (v *Vec) Subtract(u *Vec)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vec ¶
type Vec struct {
X, Y float64
}
Vec is a two dimensional vector
func (*Vec) Cap ¶
Cap limits the length of a vector. If it is longer than max, it will be cut down to length max
func (*Vec) SetMagnitude ¶
SetMagnitude sets the magnitude of the vector to l
Click to show internal directories.
Click to hide internal directories.