mth

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(value, min, max float64) float64

func Fix

func Fix(x float64) fixed.Int26_6

func Fixp

func Fixp(x, y float64) fixed.Point26_6

Types

type M

type M struct {
	MX   []float64
	W, H int
}

func NewMatrix

func NewMatrix(width, height int) *M

func (*M) Absum

func (m *M) Absum() float64

func (*M) At

func (m *M) At(x, y int) float64

func (*M) MaxX

func (m *M) MaxX() int

func (*M) MaxY

func (m *M) MaxY() int

func (*M) Normalized

func (m *M) Normalized() Matrix

func (*M) String

func (m *M) String() string

type Matrix

type Matrix interface {
	At(x, y int) float64
	Normalized() Matrix
	MaxX() int
	MaxY() int
}

type V2

type V2 struct {
	X, Y float64
}

func (V2) Abs

func (v V2) Abs() V2

func (V2) Add

func (a V2) Add(b V2) V2

func (V2) Len

func (v V2) Len() float64

func (V2) Len2

func (v V2) Len2() float64

func (V2) LenV

func (v V2) LenV() V2

func (V2) Offset

func (a V2) Offset(s float64) V2

func (V2) Scale

func (v V2) Scale(s float64) V2

type V3

type V3 struct {
	X, Y, Z float64
}

func (V3) Abs

func (v V3) Abs() V3

func (V3) Add

func (a V3) Add(b V3) V3

func (V3) Len

func (v V3) Len() float64

func (V3) Len2

func (v V3) Len2() float64

func (V3) LenV

func (v V3) LenV() V3

func (V3) Offset

func (a V3) Offset(s float64) V3

func (V3) Scale

func (v V3) Scale(s float64) V3

Jump to

Keyboard shortcuts

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