matrix

package
v0.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Identity = Matrix2D{1, 0, 0, 1, 0, 0}

Identity is the identity matrix

Functions

This section is empty.

Types

type Matrix2D

type Matrix2D struct {
	A, B, C, D, E, F float64
}

Matrix2D represents an SVG style matrix

func (Matrix2D) Invert

func (a Matrix2D) Invert() Matrix2D

Invert returns the inverse matrix

func (Matrix2D) Mult

func (a Matrix2D) Mult(b Matrix2D) Matrix2D

Mult returns a*b

func (Matrix2D) Rotate

func (a Matrix2D) Rotate(theta float64) Matrix2D

Rotate rotate the matrix by theta

func (Matrix2D) Scale

func (a Matrix2D) Scale(x, y float64) Matrix2D

Scale matrix in x and y dimensions

func (Matrix2D) SkewX

func (a Matrix2D) SkewX(theta float64) Matrix2D

SkewX skews the matrix in the X dimension

func (Matrix2D) SkewY

func (a Matrix2D) SkewY(theta float64) Matrix2D

SkewY skews the matrix in the Y dimension

func (Matrix2D) TFixed

func (a Matrix2D) TFixed(x fixed.Point26_6) (y fixed.Point26_6)

TFixed transforms a fixed.Point26_6 by the matrix

func (Matrix2D) Transform

func (a Matrix2D) Transform(x1, y1 float64) (x2, y2 float64)

Transform multiples the input vector by matrix m and outputs the results vector components.

func (Matrix2D) TransformVector

func (a Matrix2D) TransformVector(x1, y1 float64) (x2, y2 float64)

TransformVector is a modidifed version of Transform that ignores the translation components.

func (Matrix2D) Translate

func (a Matrix2D) Translate(x, y float64) Matrix2D

Translate translates the matrix to the x , y point

Jump to

Keyboard shortcuts

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