Documentation ¶
Overview ¶
Package mat2 contains a 2x2 float64 matrix type T and functions.
Index ¶
- Variables
- type T
- func (mat *T) Array() *[4]float64
- func (mat *T) AssignMul(a, b *T) *T
- func (mat *T) Cols() int
- func (mat *T) Get(col, row int) float64
- func (mat *T) IsZero() bool
- func (mat *T) MulVec2(vec *vec2.T) vec2.T
- func (mat *T) Rows() int
- func (mat *T) Scale(f float64) *T
- func (mat *T) Scaled(f float64) T
- func (mat *T) Scaling() vec2.T
- func (mat *T) SetScaling(s *vec2.T) *T
- func (mat *T) Size() int
- func (mat *T) Slice() []float64
- func (mat *T) String() string
- func (mat *T) Trace() float64
- func (mat *T) TransformVec2(v *vec2.T)
- func (mat *T) Transpose() *T
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type T ¶
T represents a 2x2 matrix.
func (*T) Array ¶
Array returns the elements of the matrix as array pointer. The data may be a copy depending on the platform implementation.
func (*T) Scaled ¶
Scaled returns a copy of the matrix with the diagonal scale elements multiplied by f.
func (*T) SetScaling ¶
SetScaling sets the scaling diagonal of the matrix.
func (*T) TransformVec2 ¶
TransformVec2 multiplies v with mat and saves the result in v.
Click to show internal directories.
Click to hide internal directories.