### Accessing Matrix Elements

You can get access to matrix elements in a number of ways:

- Create an array of nine GCoordinates. The enumeration EMatrixIndex addresses the elements in the array, then construct an IGrafMatrix with this array, or you can call matrix to fill in the array, then
- Construct the matrix directly with the nine elements.
- Get and set individual elements with element and setElement functions. They allow you to logically access the "elements" of the array without forcing the matrix to actually store the information.

The code below shows the setElement function and the declaration for EMatrixIndex. Applying the matrix to a rational point (x, y, w) results in a rational point (x', y', w') using matrix multiplication:

    setElement( EMatrixIndex index, GCoordinate& element );
    EMatrixIndex{
                  kScaleX = 0,     kSheary = 1,     kPerspectiveX = 2,
                  kShearX = 3,     kScaly = 4,      kPerspectivey = 5,
                  kTranslateX = 6, kTranslatey = 7, kHomogeneous = 8
    };