Documentation
¶
Overview ¶
Package matrix2x3 implements the Matrix2x3Plugin for the SqueakVM. Ported from the JavaScript Matrix2x3Plugin (VMMaker-bf.353).
A 2x3 matrix is stored as 6 Words (uint32) reinterpreted as float32:
[ a11 a12 a13 ] words[0..2] = row 1 [ a21 a22 a23 ] words[3..5] = row 2
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeMatrix ¶
func ComposeMatrix(m1, m2, m3 []uint32)
ComposeMatrix multiplies m1 by m2 and stores the result in m3. All are 6-element float32 slices stored as uint32 words.
func InvertPoint ¶
InvertPoint applies the inverse of 2x3 matrix m to point (x,y). Returns (0, 0, false) if the matrix is singular.
func IsIdentity ¶
IsIdentity returns true if m is the identity matrix.
func IsPureTranslation ¶
IsPureTranslation returns true if m has no rotation or scaling component.
func TransformPoint ¶
TransformPoint applies the 2x3 matrix m to point (x,y).
Types ¶
type Matrix2x3Plugin ¶
type Matrix2x3Plugin struct{}
Matrix2x3Plugin implements 2x3 matrix transform primitives.
func (*Matrix2x3Plugin) Name ¶
func (p *Matrix2x3Plugin) Name() string
func (*Matrix2x3Plugin) Primitives ¶
func (p *Matrix2x3Plugin) Primitives() map[string]vm.PrimitiveFunc