f32

package
v0.0.0-...-697b985 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2019 License: BSD-3-Clause, Zlib Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x float32) float32

func Acos

func Acos(x float32) float32

func Atan2

func Atan2(y, x float32) float32

func Ceil

func Ceil(x float32) float32

func Clamp

func Clamp(x, s, e float32) float32

func Clamp8

func Clamp8(x, a, b float32) uint8

func ComplexToFloat

func ComplexToFloat(v []complex64) []float32

func Convolve1D

func Convolve1D(dst, src, coeffs []float32, shape int) []float32

func Cos

func Cos(x float32) float32

func Cosh

func Cosh(x float32) float32

func Cov1D

func Cov1D(x, y []float32, ddof float32) float32

func CubicBezier1D

func CubicBezier1D(t, p0, p1, p2, p3 float32) float32

func Deg2Rad

func Deg2Rad(d float32) float32

func Exp

func Exp(x float32) float32

func FFT1DC

func FFT1DC(dst, src []complex64)

func FFT1DR

func FFT1DR(dst []complex64, src []float32)

func FloatToComplex

func FloatToComplex(v []float32) []complex64

func Floor

func Floor(x float32) float32

func Hypot

func Hypot(x, y float32) float32

func IFFT1DC

func IFFT1DC(dst, src []complex64)

func IFFT1DR

func IFFT1DR(dst []float32, src []complex64)

func Lerp

func Lerp(t, a, b float32) float32

func LinearController

func LinearController(curpos *float32, targetpos, acc, deacc, dt float32)

func LinearRemap

func LinearRemap(x, a, b, c, d float32) float32

func Log

func Log(x float32) float32

func Log1b

func Log1b(x float32) float32

func Log1p

func Log1p(x float32) float32

func Log2

func Log2(x float32) float32

func Log10

func Log10(x float32) float32

func Max

func Max(a, b float32) float32

func Maxs

func Maxs(x ...float32) float32

func Mean

func Mean(x []float32) float32

func Median

func Median(x []float32) float32

func Min

func Min(a, b float32) float32

func Mins

func Mins(x ...float32) float32

func Mod

func Mod(x, y float32) float32

func Multiple

func Multiple(a, m float32) float32

func PearsonCorrelation1D

func PearsonCorrelation1D(x, y []float32) float32

func Pow

func Pow(x, y float32) float32

func Pow10

func Pow10(x int) float32

func Rad2Deg

func Rad2Deg(r float32) float32

func Round

func Round(x float32) float32

func RoundPrec

func RoundPrec(v float32, prec int) float32

func Sample1D

func Sample1D(f func(float32) float32, x0, x1 float32, n int) (p []float32, s float32)

func Sample2D

func Sample2D(f func(x, y float32) float32, x0, x1, y0, y1 float32, nx, ny int) (p []float32, sx, sy float32)

func Saturate

func Saturate(x float32) float32

func Sign

func Sign(x float32) float32

func SignNZ

func SignNZ(x float32) float32

func Simpson1D

func Simpson1D(f func(x float32) float32, start, end float32, n int) float32

func Simpson2D

func Simpson2D(f func(x, y float32) float32, x0, x1, y0, y1 float32, m, n int) float32

func Sin

func Sin(x float32) float32

func Sinc

func Sinc(x float32) float32

func Sincos

func Sincos(x float32) (si, co float32)

func Sinh

func Sinh(x float32) float32

func Smoothstep

func Smoothstep(a, b, x float32) float32

func Sqrt

func Sqrt(x float32) float32

func Stddev

func Stddev(x []float32, ddof float32) float32

func Tan

func Tan(x float32) float32

func Tanh

func Tanh(x float32) float32

func Trunc

func Trunc(x float32) float32

func Unlerp

func Unlerp(t, a, b float32) float32

func Wrap

func Wrap(x, s, e float32) float32

Types

type Circle

type Circle struct {
	X, Y, R float32
}

func (Circle) InPoint

func (c Circle) InPoint(x, y float32) bool

func (Circle) InRect

func (c Circle) InRect(r Rectangle) bool

type Mat2

type Mat2 [2][2]float32

func (*Mat2) Col

func (m *Mat2) Col(n int) Vec2

func (*Mat2) Det

func (m *Mat2) Det() float32

func (*Mat2) Inverse

func (m *Mat2) Inverse() *Mat2

func (*Mat2) Mul

func (m *Mat2) Mul(a, b *Mat2) *Mat2

func (*Mat2) Row

func (m *Mat2) Row(n int) Vec2

func (Mat2) String

func (m Mat2) String() string

func (*Mat2) Trace

func (m *Mat2) Trace() float32

func (*Mat2) Transform

func (m *Mat2) Transform(p Vec2) Vec2

func (*Mat2) Transpose

func (m *Mat2) Transpose() *Mat2

type Mat3

type Mat3 [3][3]float32

func (*Mat3) Basis

func (m *Mat3) Basis() (X, Y, Z, W Vec3)

func (*Mat3) Col

func (m *Mat3) Col(n int) Vec3

func (*Mat3) Det

func (m *Mat3) Det() float32

func (*Mat3) FromBasis

func (m *Mat3) FromBasis(X, Y, Z Vec3) *Mat3

func (*Mat3) Identity

func (m *Mat3) Identity() *Mat3

func (*Mat3) Inverse

func (m *Mat3) Inverse() *Mat3

func (*Mat3) Mat4

func (m *Mat3) Mat4() Mat4

func (*Mat3) Mul

func (m *Mat3) Mul(a, b *Mat3) *Mat3

func (*Mat3) Row

func (m *Mat3) Row(n int) Vec3

func (*Mat3) SetCol

func (m *Mat3) SetCol(n int, p Vec3)

func (*Mat3) SetRow

func (m *Mat3) SetRow(n int, p Vec3)

func (Mat3) String

func (m Mat3) String() string

func (*Mat3) Trace

func (m *Mat3) Trace() float32

func (*Mat3) Transform

func (m *Mat3) Transform(p Vec3) Vec3

func (*Mat3) Transpose

func (m *Mat3) Transpose() *Mat3

type Mat4

type Mat4 [4][4]float32

func (*Mat4) Add

func (m *Mat4) Add(a, b *Mat4) *Mat4

func (*Mat4) Basis

func (m *Mat4) Basis() (X, Y, Z, W Vec4)

func (*Mat4) Basis3

func (m *Mat4) Basis3() (X, Y, Z, W Vec3)

func (*Mat4) Col

func (m *Mat4) Col(n int) Vec4

func (*Mat4) FromBasis

func (m *Mat4) FromBasis(X, Y, Z, W Vec4) *Mat4

func (*Mat4) FromBasis3

func (m *Mat4) FromBasis3(X, Y, Z, W Vec3) *Mat4

func (*Mat4) Frustum

func (m *Mat4) Frustum(l, r, b, t, n, f float32) *Mat4

func (*Mat4) Identity

func (m *Mat4) Identity() *Mat4

func (*Mat4) InfinitePerspective

func (m *Mat4) InfinitePerspective(fovy, aspect, near float32) *Mat4

func (*Mat4) Inverse

func (m *Mat4) Inverse() *Mat4

func (*Mat4) LookAt

func (m *Mat4) LookAt(eye, center, up Vec3) *Mat4

func (*Mat4) Mul

func (m *Mat4) Mul(a, b *Mat4) *Mat4

func (*Mat4) Ortho

func (m *Mat4) Ortho(l, r, b, t, n, f float32) *Mat4

func (*Mat4) Perspective

func (m *Mat4) Perspective(fovy, aspect, near, far float32) *Mat4

func (*Mat4) RotateX

func (m *Mat4) RotateX(r float32) *Mat4

func (*Mat4) RotateY

func (m *Mat4) RotateY(r float32) *Mat4

func (*Mat4) RotateZ

func (m *Mat4) RotateZ(r float32) *Mat4

func (*Mat4) Row

func (m *Mat4) Row(n int) Vec4

func (*Mat4) Scale

func (m *Mat4) Scale(sx, sy, sz float32) *Mat4

func (*Mat4) Scale3

func (m *Mat4) Scale3(p Vec3) *Mat4

func (*Mat4) SetCol

func (m *Mat4) SetCol(n int, p Vec4)

func (*Mat4) SetRow

func (m *Mat4) SetRow(n int, p Vec4)

func (Mat4) String

func (m Mat4) String() string

func (*Mat4) Sub

func (m *Mat4) Sub(a, b *Mat4) *Mat4

func (*Mat4) Trace

func (m *Mat4) Trace() float32

func (*Mat4) Transform

func (m *Mat4) Transform(v Vec4) Vec4

func (*Mat4) Transform3

func (m *Mat4) Transform3(v Vec3) Vec3

func (*Mat4) Translate

func (m *Mat4) Translate(tx, ty, tz float32) *Mat4

func (*Mat4) Translate3

func (m *Mat4) Translate3(p Vec3) *Mat4

func (*Mat4) Transpose

func (m *Mat4) Transpose() *Mat4

func (*Mat4) Viewport

func (m *Mat4) Viewport(x, y, w, h float32) *Mat4

type Polar

type Polar struct {
	R, P float32
}

func (*Polar) Cartesian

func (p *Polar) Cartesian() Vec2

type Quat

type Quat struct {
	X, Y, Z, W float32
}

func (Quat) Add

func (q Quat) Add(r Quat) Quat

func (Quat) AxisAngle

func (q Quat) AxisAngle() (v Vec3, r float32)

func (Quat) Conj

func (q Quat) Conj() Quat

func (Quat) Dot

func (q Quat) Dot(p Quat) float32

func (Quat) FromAxisAngle

func (q Quat) FromAxisAngle(v Vec3, r float32) Quat

func (Quat) FromEuler

func (q Quat) FromEuler(pitch, yaw, roll float32) Quat

func (Quat) Inverse

func (q Quat) Inverse() Quat

func (Quat) Len

func (q Quat) Len() float32

func (Quat) Lerp

func (q Quat) Lerp(t float32, p Quat) Quat

func (Quat) Mat3

func (q Quat) Mat3() Mat3

func (Quat) Mat4

func (q Quat) Mat4() Mat4

func (Quat) Mul

func (q Quat) Mul(r Quat) Quat

func (Quat) Neg

func (q Quat) Neg() Quat

func (Quat) Normalize

func (q Quat) Normalize() Quat

func (Quat) Powu

func (q Quat) Powu(p float32) Quat

func (Quat) Scale

func (q Quat) Scale(k float32) Quat

func (Quat) Slerp

func (q Quat) Slerp(t float32, p Quat) Quat

func (Quat) String

func (q Quat) String() string

func (Quat) Sub

func (q Quat) Sub(r Quat) Quat

func (Quat) Transform3

func (q Quat) Transform3(v Vec3) Vec3

func (Quat) Transform4

func (q Quat) Transform4(v Vec4) Vec4

type Rectangle

type Rectangle struct {
	Min, Max Vec2
}

func Rect

func Rect(x0, y0, x1, y1 float32) Rectangle

func (Rectangle) Add

func (r Rectangle) Add(p Vec2) Rectangle

func (Rectangle) BL

func (r Rectangle) BL() Vec2

func (Rectangle) BR

func (r Rectangle) BR() Vec2

func (Rectangle) Canon

func (r Rectangle) Canon() Rectangle

func (Rectangle) Center

func (r Rectangle) Center() Vec2

func (Rectangle) Diagonal

func (r Rectangle) Diagonal() float32

func (Rectangle) Dx

func (r Rectangle) Dx() float32

func (Rectangle) Dy

func (r Rectangle) Dy() float32

func (Rectangle) Empty

func (r Rectangle) Empty() bool

func (Rectangle) Expand

func (r Rectangle) Expand(x, y float32) Rectangle

func (Rectangle) Expand2

func (r Rectangle) Expand2(v Vec2) Rectangle

func (Rectangle) In

func (r Rectangle) In(s Rectangle) bool

func (Rectangle) Inset

func (r Rectangle) Inset(n float32) Rectangle

func (Rectangle) Int

func (r Rectangle) Int() image.Rectangle

func (Rectangle) Intersect

func (r Rectangle) Intersect(s Rectangle) Rectangle

func (Rectangle) Inverted

func (r Rectangle) Inverted() bool

func (Rectangle) Overlaps

func (r Rectangle) Overlaps(s Rectangle) bool

func (Rectangle) PosSize

func (r Rectangle) PosSize() (x, y, w, h float32)

func (Rectangle) Scale

func (r Rectangle) Scale(s Vec2) Rectangle

func (Rectangle) Size

func (r Rectangle) Size() Vec2

func (Rectangle) Sub

func (r Rectangle) Sub(p Vec2) Rectangle

func (Rectangle) TL

func (r Rectangle) TL() Vec2

func (Rectangle) TR

func (r Rectangle) TR() Vec2

func (Rectangle) Union

func (r Rectangle) Union(s Rectangle) Rectangle

type Spherical

type Spherical struct {
	R, T, P float32
}

func (Spherical) Euclidean

func (s Spherical) Euclidean() Vec3

type Vec2

type Vec2 struct {
	X, Y float32
}

func (Vec2) Abs

func (p Vec2) Abs() Vec2

func (Vec2) Add

func (p Vec2) Add(q Vec2) Vec2

func (Vec2) AddScale

func (p Vec2) AddScale(q Vec2, t float32) Vec2

func (Vec2) Angle

func (p Vec2) Angle(q Vec2) float32

func (Vec2) Ceil

func (p Vec2) Ceil() Vec2

func (Vec2) Clamp

func (p Vec2) Clamp(s, e float32) Vec2

func (Vec2) Clamp2

func (p Vec2) Clamp2(s, e Vec2) Vec2

func (Vec2) Distance

func (p Vec2) Distance(q Vec2) float32

func (Vec2) DistanceSquared

func (p Vec2) DistanceSquared(q Vec2) float32

func (Vec2) Dot

func (p Vec2) Dot(q Vec2) float32

func (Vec2) Equals

func (p Vec2) Equals(q Vec2, eps float32) bool

func (Vec2) Floor

func (p Vec2) Floor() Vec2

func (Vec2) In

func (p Vec2) In(r Rectangle) bool

func (Vec2) Len

func (p Vec2) Len() float32

func (Vec2) LenSquared

func (p Vec2) LenSquared() float32

func (Vec2) Lerp

func (p Vec2) Lerp(t float32, q Vec2) Vec2

func (Vec2) Lerp2

func (p Vec2) Lerp2(t, q Vec2) Vec2

func (Vec2) Max

func (p Vec2) Max(q Vec2) Vec2

func (Vec2) MaxComp

func (p Vec2) MaxComp() float32

func (Vec2) MaxScalar

func (p Vec2) MaxScalar(k float32) Vec2

func (Vec2) Min

func (p Vec2) Min(q Vec2) Vec2

func (Vec2) MinComp

func (p Vec2) MinComp() float32

func (Vec2) MinScalar

func (p Vec2) MinScalar(k float32) Vec2

func (Vec2) Neg

func (p Vec2) Neg() Vec2

func (Vec2) Normalize

func (p Vec2) Normalize() Vec2

func (Vec2) OnLine

func (p Vec2) OnLine(a, b Vec2) bool

func (Vec2) Point3

func (p Vec2) Point3() Vec3

func (Vec2) Polar

func (p Vec2) Polar() Polar

func (Vec2) Rotate

func (p Vec2) Rotate(r float32) Vec2

func (Vec2) Scale

func (p Vec2) Scale(k float32) Vec2

func (Vec2) Scale2

func (p Vec2) Scale2(q Vec2) Vec2

func (Vec2) Shear

func (p Vec2) Shear(k float32) Vec2

func (Vec2) Shearv

func (p Vec2) Shearv(q Vec2) Vec2

func (Vec2) Shrink

func (p Vec2) Shrink(k float32) Vec2

func (Vec2) Shrink2

func (p Vec2) Shrink2(q Vec2) Vec2

func (Vec2) String

func (p Vec2) String() string

func (Vec2) Sub

func (p Vec2) Sub(q Vec2) Vec2

func (Vec2) SubScale

func (p Vec2) SubScale(q Vec2, t float32) Vec2

func (Vec2) Vec3

func (p Vec2) Vec3() Vec3

func (Vec2) Wrap

func (p Vec2) Wrap(s, e float32) Vec2

func (Vec2) YX

func (p Vec2) YX() Vec2

type Vec3

type Vec3 struct {
	X, Y, Z float32
}

func TriangleBarycentric

func TriangleBarycentric(p, a, b, c Vec2) Vec3

func (Vec3) Abs

func (p Vec3) Abs() Vec3

func (Vec3) Add

func (p Vec3) Add(q Vec3) Vec3

func (Vec3) AddScale

func (p Vec3) AddScale(q Vec3, t float32) Vec3

func (Vec3) Angle

func (p Vec3) Angle(q Vec3) float32

func (Vec3) Clamp

func (p Vec3) Clamp(s, e float32) Vec3

func (Vec3) Clamp3

func (p Vec3) Clamp3(s, e Vec3) Vec3

func (Vec3) Cross

func (p Vec3) Cross(q Vec3) Vec3

func (Vec3) CrossNormalize

func (p Vec3) CrossNormalize(q Vec3) Vec3

func (Vec3) Distance

func (p Vec3) Distance(q Vec3) float32

func (Vec3) DistanceSquared

func (p Vec3) DistanceSquared(q Vec3) float32

func (Vec3) Dot

func (p Vec3) Dot(q Vec3) float32

func (Vec3) Equals

func (p Vec3) Equals(q Vec3, eps float32) bool

func (Vec3) Len

func (p Vec3) Len() float32

func (Vec3) LenSquared

func (p Vec3) LenSquared() float32

func (Vec3) Lerp

func (p Vec3) Lerp(t float32, q Vec3) Vec3

func (Vec3) Max

func (p Vec3) Max(q Vec3) Vec3

func (Vec3) MaxComp

func (p Vec3) MaxComp() float32

func (Vec3) MaxScalar

func (p Vec3) MaxScalar(k float32) Vec3

func (Vec3) Min

func (p Vec3) Min(q Vec3) Vec3

func (Vec3) MinComp

func (p Vec3) MinComp() float32

func (Vec3) MinScalar

func (p Vec3) MinScalar(k float32) Vec3

func (Vec3) Neg

func (p Vec3) Neg() Vec3

func (Vec3) Normalize

func (p Vec3) Normalize() Vec3

func (Vec3) Point4

func (p Vec3) Point4() Vec4

func (Vec3) RGBA

func (p Vec3) RGBA() (r, g, b, a uint32)

func (Vec3) Reflect

func (p Vec3) Reflect(q Vec3) Vec3

func (Vec3) Refract

func (p Vec3) Refract(q Vec3, eta float32) Vec3

func (Vec3) Scale

func (p Vec3) Scale(k float32) Vec3

func (Vec3) Scale3

func (p Vec3) Scale3(q Vec3) Vec3

func (Vec3) Shrink

func (p Vec3) Shrink(k float32) Vec3

func (Vec3) Shrink3

func (p Vec3) Shrink3(q Vec3) Vec3

func (Vec3) Spherical

func (p Vec3) Spherical() Spherical

func (Vec3) String

func (p Vec3) String() string

func (Vec3) Sub

func (p Vec3) Sub(q Vec3) Vec3

func (Vec3) SubScale

func (p Vec3) SubScale(q Vec3, t float32) Vec3

func (Vec3) ToRGBA

func (p Vec3) ToRGBA() color.RGBA

func (Vec3) Vec4

func (p Vec3) Vec4() Vec4

func (Vec3) XY

func (p Vec3) XY() Vec2

func (Vec3) XZ

func (p Vec3) XZ() Vec2

func (Vec3) YX

func (p Vec3) YX() Vec2

func (Vec3) YZ

func (p Vec3) YZ() Vec2

func (Vec3) ZX

func (p Vec3) ZX() Vec2

func (Vec3) ZY

func (p Vec3) ZY() Vec2

type Vec4

type Vec4 struct {
	X, Y, Z, W float32
}

func (Vec4) Add

func (p Vec4) Add(q Vec4) Vec4

func (Vec4) AddScale

func (p Vec4) AddScale(q Vec4, k float32) Vec4

func (Vec4) Angle

func (p Vec4) Angle(q Vec4) float32

func (Vec4) Dot

func (p Vec4) Dot(q Vec4) float32

func (Vec4) Len

func (p Vec4) Len() float32

func (Vec4) Normalize

func (p Vec4) Normalize() Vec4

func (Vec4) PerspectiveDivide

func (p Vec4) PerspectiveDivide() Vec4

func (Vec4) RGBA

func (p Vec4) RGBA() (r, g, b, a uint32)

func (Vec4) Scale

func (p Vec4) Scale(k float32) Vec4

func (Vec4) Scale4

func (p Vec4) Scale4(q Vec4) Vec4

func (Vec4) Shrink

func (p Vec4) Shrink(k float32) Vec4

func (Vec4) Shrink4

func (p Vec4) Shrink4(q Vec4) Vec4

func (Vec4) String

func (p Vec4) String() string

func (Vec4) Sub

func (p Vec4) Sub(q Vec4) Vec4

func (Vec4) SubScale

func (p Vec4) SubScale(q Vec4, k float32) Vec4

func (Vec4) ToRGBA

func (p Vec4) ToRGBA() color.RGBA

func (Vec4) XYZ

func (p Vec4) XYZ() Vec3

func (Vec4) XZY

func (p Vec4) XZY() Vec3

func (Vec4) YXZ

func (p Vec4) YXZ() Vec3

func (Vec4) YZX

func (p Vec4) YZX() Vec3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL