Documentation ¶
Index ¶
- Constants
- Variables
- func ScalarEqualsEpsilon(a, b, epsilon float64) bool
- type Rect
- type Vec
- func (v Vec) Add(other Vec) Vec
- func (v Vec) Angle() float64
- func (v Vec) Applyed()
- func (v Vec) Clamp(min, max Vec) Vec
- func (v Vec) Cross(other Vec) float64
- func (v Vec) Dot(other Vec) float64
- func (v Vec) Equals(other Vec) bool
- func (v Vec) EqualsEpsilon(other Vec) bool
- func (v Vec) EqualsEpsilon2(other Vec, epsilon float64) bool
- func (v Vec) IsZero() bool
- func (v Vec) Magnitude() float64
- func (v Vec) Mul(other Vec) Vec
- func (v Vec) Normalized() Vec
- func (v Vec) RectClamp(r Rect) Vec
- func (v Vec) Scaled(s float64) Vec
- func (v Vec) ScaledXY(sx, sy float64) Vec
- func (v Vec) Sub(other Vec) Vec
Constants ¶
View Source
const ( // Epsilon is the default value to compare is scalars are nearly equal // It can be as low as math.SmallestNonzeroFloat64 Epsilon = 1e-16 )
Variables ¶
View Source
var ZV = Vec{}
ZV = Vec{0,0}
Functions ¶
func ScalarEqualsEpsilon ¶
Types ¶
type Rect ¶
func (Rect) ContainsVec ¶
type Vec ¶
Vec is a 2d Vector
func (Vec) EqualsEpsilon ¶
func (Vec) Normalized ¶
Normalized normalizes a vector. Also known as direction, unit vector.
Click to show internal directories.
Click to hide internal directories.