1. Home
  2. Computing & Technology
  3. Animation

Matrix

By , About.com Guide

Definition: A matrix is a rectangular array with an extra dimension added; where a normal array is a list, a matrix is defined by X rows across and Y columns down with information stored in its correct row and column.

Example:

4 3 1
6 8 9
2 5 3

Above is a 3x3 matrix storing 9 numbers.

In ActionScripting, Flash uses matrices as part of the transformation matrix, which can be either a 3x3 matrix in which values are taken from an array in the format:

a b c
d e f
g h i

and read in the order:

matrix = { a:20, b:30, c:40, d:50, e:60, f:70, g:80, h:90, i:100 };

Or the matrix can be defined as a matrix type:

matrix = { matrixType:"box", x:300, y:300, w:100, h:250, r:(90/180)*Math.PI };

in which the values, instead of being taken from a 3x3 storage array, are instead assigned to preset values for that type. For instance, a box type matrix needs an x and y coordinate, a width and height, and in this case a radius (when being used for a gradient fill).

Transformation matrices are used most often in the begingradientfill function.

Explore Animation
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. FAQs and Glossary Terms
  5. Glossary of Terms
  6. Glossary: Matrix

©2009 About.com, a part of The New York Times Company.

All rights reserved.