Documentation ¶
Overview ¶
Package mat2 contains a 2x2 float32 matrix type T and functions.
Index ¶
- Variables
- type T
- func (mat *T) Array() *[4]float32
- func (mat *T) AssignMul(a, b *T) *T
- func (mat *T) Cols() int
- func (mat *T) Get(col, row int) float32
- func (mat *T) IsZero() bool
- func (mat *T) MulVec2(v *vec2.T) vec2.T
- func (mat *T) Rows() int
- func (mat *T) Scale(f float32) *T
- func (mat *T) Scaled(f float32) T
- func (mat *T) Scaling() vec2.T
- func (mat *T) SetScaling(s *vec2.T) *T
- func (mat *T) Size() int
- func (mat *T) Slice() []float32
- func (mat *T) String() string
- func (mat *T) Trace() float32
- 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) Slice ¶
Slice returns the elements of the matrix as slice. The data may be a copy depending on the platform implementation.
func (*T) TransformVec2 ¶
TransformVec2 multiplies v with mat and saves the result in v.
Click to show internal directories.
Click to hide internal directories.