mat64

package
v0.0.0-...-e56f4fe Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2014 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package mat64 provides a type for representing and manipulating a 4x4 matrix of float64.

Index

Constants

This section is empty.

Variables

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

Identity can be multiplied by another matrix to produce the same matrix.

Functions

This section is empty.

Types

type Matrix

type Matrix [4]vec64.Vector

Matrix holds a 4x4 matrix. Each vector is a column of the matrix.

func Mul

func Mul(m1, m2 Matrix) Matrix

Mul multiplies m1 by m2.

func (Matrix) Rotate

func (m Matrix) Rotate(angle float64, axis vec64.Vector) Matrix

Rotate post-multiplies a rotation around an axis. The angle is in radians and the axis will be normalized.

func (Matrix) Scale

func (m Matrix) Scale(scale vec64.Vector) Matrix

Scale post-multiplies a scale and returns the result.

func (Matrix) String

func (m Matrix) String() string

func (Matrix) Transform

func (m Matrix) Transform(u vec64.Vector) (v vec64.Vector)

Transform multiplies m by u.

func (Matrix) Translate

func (m Matrix) Translate(v vec64.Vector) Matrix

Translate post-multiplies a translation by v and returns the result.

func (Matrix) Transpose

func (m Matrix) Transpose() Matrix

Transpose performs a matrix transposition.

Jump to

Keyboard shortcuts

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