Versions in this module Expand all Collapse all v0 v0.4.0 Dec 10, 2023 v0.3.0 Dec 9, 2023 v0.2.1 Apr 21, 2022 v0.2.0 Nov 3, 2020 Changes in this version + const MaxInt + const MaxUint + const MinInt + const MinUint + const Pi + const TwoPi + var MaxSize = Size + func Absf(v float32) float32 + func Acosf(v float32) float32 + func Asinf(v float32) float32 + func Atanf(v float32) float32 + func Clamp(x, min, max int) int + func Clampf(x, min, max float32) float32 + func Cosf(v float32) float32 + func D2R(r float32) float32 + func Lerp(a, b int, s float32) int + func Lerpf(a, b float32, s float32) float32 + func Max(values ...int) int + func Maxf(values ...float32) float32 + func Min(values ...int) int + func Minf(values ...float32) float32 + func Mod(a, b int) int + func Powf(v, e float32) float32 + func R2D(r float32) float32 + func Ramp(s float32, a, b float32) float32 + func RampSat(s float32, a, b float32) float32 + func Round(v float32) int + func Saturate(x float32) float32 + func Sinf(v float32) float32 + func SmoothStep(s float32, a, b float32) float32 + func Sqrtf(v float32) float32 + func Tanf(v float32) float32 + type Mat2 [4]float32 + var Mat2Ident Mat2 = CreateMat2(1, 0, 0, 1) + func CreateMat2(r0c0, r0c1, r1c0, r1c1 float32) Mat2 + func CreateMat2FromRows(r0, r1 Vec2) Mat2 + func DivM2S(m Mat2, s float32) Mat2 + func (m Mat2) Invert() Mat2 + func (m Mat2) Row(i int) Vec2 + func (m Mat2) Rows() (r0, r1 Vec2) + func (m Mat2) String() string + func (m Mat2) Transpose() Mat2 + type Mat3 [9]float32 + var Mat3Ident Mat3 = CreateMat3(1, 0, 0, 0, 1, 0, 0, 0, 1) + func CreateMat3(r0c0, r0c1, r0c2, r1c0, r1c1, r1c2, r2c0, r2c1, r2c2 float32) Mat3 + func CreateMat3FromRows(r0, r1, r2 Vec3) Mat3 + func CreateMat3PositionToBarycentric(a, b, c Vec2) Mat3 + func (m Mat3) DivS(s float32) Mat3 + func (m Mat3) Invert() Mat3 + func (m Mat3) Row(i int) Vec3 + func (m Mat3) Rows() (r0, r1, r2 Vec3) + func (m Mat3) String() string + func (m Mat3) Transpose() Mat3 + type Point struct + X int + Y int + var ZeroPoint Point + func NewPoint(X, Y int) Point + func (p Point) Add(o Point) Point + func (p Point) AddX(o int) Point + func (p Point) AddY(o int) Point + func (p Point) Clamp(min, max Point) Point + func (p Point) Dot(o Point) int + func (p Point) Len() float32 + func (p Point) Max(o Point) Point + func (p Point) Min(o Point) Point + func (p Point) Neg() Point + func (p Point) Remap(from, to Rect) Point + func (p Point) Scale(s Vec2) Point + func (p Point) ScaleS(s float32) Point + func (p Point) ScaleX(s float32) Point + func (p Point) ScaleY(s float32) Point + func (p Point) Size() Size + func (p Point) SqrLen() int + func (p Point) Sub(o Point) Point + func (p Point) Vec2() Vec2 + func (p Point) Vec3(z float32) Vec3 + func (p Point) XY() (x, y int) + type Rect struct + Max Point + Min Point + func CreateRect(minX, minY, maxX, maxY int) Rect + func (r Rect) BC() Point + func (r Rect) BL() Point + func (r Rect) BR() Point + func (r Rect) Canon() Rect + func (r Rect) ClampXY(x, y int) (int, int) + func (r Rect) Constrain(o Rect) Rect + func (r Rect) Contains(p Point) bool + func (r Rect) Contract(s Spacing) Rect + func (r Rect) ContractI(s int) Rect + func (r Rect) Expand(s Spacing) Rect + func (r Rect) ExpandI(s int) Rect + func (r Rect) Frac(v Point) Vec2 + func (r Rect) H() int + func (r Rect) Intersect(o Rect) Rect + func (r Rect) Lerp(v Vec2) Point + func (r Rect) ML() Point + func (r Rect) MR() Point + func (r Rect) Mid() Point + func (r Rect) Offset(p Point) Rect + func (r Rect) OffsetX(i int) Rect + func (r Rect) OffsetY(i int) Rect + func (r Rect) Remap(from, to Rect) Rect + func (r Rect) ScaleAt(p Point, s Vec2) Rect + func (r Rect) ScaleS(s float32) Rect + func (r Rect) Size() Size + func (r Rect) TC() Point + func (r Rect) TL() Point + func (r Rect) TR() Point + func (r Rect) Union(o Rect) Rect + func (r Rect) W() int + type Size struct + H int + W int + var ZeroSize Size + func (s Size) Add(o Size) Size + func (s Size) Area() int + func (s Size) CenteredRect() Rect + func (s Size) Clamp(min, max Size) Size + func (s Size) Contract(sp Spacing) Size + func (s Size) EdgeAlignedFit(outer Rect, edgePoint Point) Rect + func (s Size) Expand(sp Spacing) Size + func (s Size) Max(o Size) Size + func (s Size) Min(o Size) Size + func (s Size) Point() Point + func (s Size) Rect() Rect + func (s Size) Scale(v Vec2) Size + func (s Size) ScaleS(v float32) Size + func (s Size) Sub(o Size) Size + func (s Size) Vec2() Vec2 + func (s Size) WH() (w, h int) + type Spacing struct + B int + L int + R int + T int + var ZeroSpacing Spacing + func CreateSpacing(s int) Spacing + func (s Spacing) Add(o Spacing) Spacing + func (s Spacing) H() int + func (s Spacing) LT() Point + func (s Spacing) Max(o Spacing) Spacing + func (s Spacing) Min(o Spacing) Spacing + func (s Spacing) Size() Size + func (s Spacing) Sub(o Spacing) Spacing + func (s Spacing) W() int + type Vec2 struct + X float32 + Y float32 + func MulVM2(v Vec2, m Mat2) Vec2 + func (v Vec2) Add(o Vec2) Vec2 + func (v Vec2) Cross(o Vec2) float32 + func (v Vec2) Div(o Vec2) Vec2 + func (v Vec2) DivS(s float32) Vec2 + func (v Vec2) Dot(o Vec2) float32 + func (v Vec2) Len() float32 + func (v Vec2) Mul(o Vec2) Vec2 + func (v Vec2) MulS(s float32) Vec2 + func (v Vec2) Neg() Vec2 + func (v Vec2) Normalize() Vec2 + func (v Vec2) Point() Point + func (v Vec2) SqrLen() float32 + func (v Vec2) Sub(o Vec2) Vec2 + func (v Vec2) Tangent() Vec2 + func (v Vec2) Vec3(z float32) Vec3 + func (v Vec2) Vec4(z, w float32) Vec4 + func (v Vec2) XY() (x, y float32) + func (v Vec2) ZeroLength() bool + type Vec3 struct + X float32 + Y float32 + Z float32 + func (v Vec3) Add(o Vec3) Vec3 + func (v Vec3) Cross(o Vec3) Vec3 + func (v Vec3) Div(o Vec3) Vec3 + func (v Vec3) DivS(s float32) Vec3 + func (v Vec3) Dot(o Vec3) float32 + func (v Vec3) Len() float32 + func (v Vec3) Mul(o Vec3) Vec3 + func (v Vec3) MulM(m Mat3) Vec3 + func (v Vec3) MulS(s float32) Vec3 + func (v Vec3) Neg() Vec3 + func (v Vec3) Normalize() Vec3 + func (v Vec3) SqrLen() float32 + func (v Vec3) String() string + func (v Vec3) Sub(o Vec3) Vec3 + func (v Vec3) XY() Vec2 + type Vec4 struct + W float32 + X float32 + Y float32 + Z float32 + func (v Vec4) Add(o Vec4) Vec4 + func (v Vec4) Div(o Vec4) Vec4 + func (v Vec4) DivS(s float32) Vec4 + func (v Vec4) Dot(o Vec4) float32 + func (v Vec4) Len() float32 + func (v Vec4) Mul(o Vec4) Vec4 + func (v Vec4) MulS(s float32) Vec4 + func (v Vec4) Neg() Vec4 + func (v Vec4) Normalize() Vec4 + func (v Vec4) SqrLen() float32 + func (v Vec4) String() string + func (v Vec4) Sub(o Vec4) Vec4 + func (v Vec4) XY() Vec2