matrix2x3

package
v0.0.0-...-2753795 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

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

func InvertPoint(m []uint32, x, y float64) (rx, ry float64, ok bool)

InvertPoint applies the inverse of 2x3 matrix m to point (x,y). Returns (0, 0, false) if the matrix is singular.

func IsIdentity

func IsIdentity(m []uint32) bool

IsIdentity returns true if m is the identity matrix.

func IsPureTranslation

func IsPureTranslation(m []uint32) bool

IsPureTranslation returns true if m has no rotation or scaling component.

func TransformPoint

func TransformPoint(m []uint32, x, y float64) (rx, ry float64)

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

Jump to

Keyboard shortcuts

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