overview | basic concepts | gops | gprims | animation | rendering | math | index

al math


vectors | matrices | splines | other math tools

Matrices

(mat3 a00 a01 a02 a10 a11 ... a22)
(mat4 a00 a01 a02 a03 a10 a11 ... a33)

Retrun a new mat3 or mat4 respectively. Each element, aij, is a real.

(mat3? x)
(mat4? x)

Returns #t if x is a mat3 and mat4 respectively.

(mat3-copy mat3)
(mat4-copy mat4)

Returns a newly allocated copy of the mat3 or mat4 specified respectively.

(mat3-ref mat3 i j)
(mat4-ref mat4 i j)

Returns the element in row i column j of the mat3 or mat4 specified.

(mat3-set! mat3 i j x)
(mat4-set! mat4 i j x)

Stores x in row i column j of a mat3 or mat4 respectively.

(mat3-row mat3 i)
(mat3-col mat3 j)
(mat4-row mat4 i)
(mat4-col mat4 j)

Return row i or column j of the mat3s or mat4s respectively.

(= mat mat ...)
(<> mat mat ...)

Matrix comparison.

(+ mat ...)
(- mat ...)
(* mat mat...)
(* mat real ...)
(* real mat ...)
(/ mat real ...)

These procedures perform (respectively): matrix addition, matrix subtraction, matrix multiplication, matrix-scalar multiplication, scalar-matrix multiplication, and matrix-scalar division.

(* vec3 mat3 ...)
(* mat3 vec3 ...)
(* vec4 mat4 ...)
(* mat4 vec4 ...)

These procedures perform row-matrix multiplication and matrix-column multiplication for mat3s and mat4s respectively.

(transform-point vec2 mat3)
(transform-point vec3 mat4)

Transforms the point, stored as a vec2 (vec3), by the specified transformation matrix, stored as a mat3 (mat4). The input point is treated as a homogeneous point with w = 1 and the returned point is automatically divided by the transformed w.

(inverse mat)
(transpose mat)
(determinant mat)

Compute the inverse, transpose, and determinant of a mat3 or mat4. inverse will generate an error if mat is singular. In each case, a new matrix is returned; mat is not modified.

(mat3-identity)
(mat3-rotate angle)
(mat3-scale vec2)
(mat3-translate vec2)
(mat4-identity)
(mat4-rotate angle axis)
(mat4-scale vec3)
(mat4-translate vec3)

These procedures return mat3 and mat4 transformation matrices, respectively, corresponding to the basic affine transformations.


AL: The Animation Language is Copyright © 1995,1996, Stephen F. May

Last updated: 1/29/96 / Steve May ( smay@cgrg.ohio-state.edu )
Any comments or suggestions appreciated.