# Matrices

The easiest way to create a matrix in GeoGebra is to use the spreadsheet. The matrix

\[\mathbf{A}=\left( \begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ \end{array} \right)\]

is entered as in the picture below. Then you select the six cells and choose the spreadsheet tool "Create Matrix".

In the window that pops up, you can give the matrix a name before clicking on `Create`

.

If you click on the small arrow below the input bar, you can find all commands for vectors and matrices.

As an example you can create another matrix that is the transpose of \(\mathbf{A}\) by using the command
`Transpose[A]`

. The transpose
\(\mathbf{A^T}\) of a matrix \(\mathbf{A}\), is the result when swapping the columns and the rows.

\[\mathbf{A^T}=\left( \begin{array}{ccc} 1 & 4 \\ 2 & 5 \\ 3 & 6 \\ \end{array} \right)\]

If you want to use an element of a matrix, you can use the command
`Element[<matrix>, <row>, <column>]`

.
If you enter `Element[A,2,3]`

, 6 is returned.

## Points/vectors and matrices in GeoGebra

A vector can be seen as a matrix with one column, a \(m\times 1\) matrix. The vector \(\mathbf{u}\) below is a \(2\times 1\) matrix.

\[\mathbf{u}=\left( \begin{array}{ccc} a \\ b \\ \end{array} \right)\]

A visual point `P` having the coordinates (`a`,`b`)
is represented like this `P=(a,b)`

in GeoGebra.

You get the `x`- and `y`-coordinate of a point `P` by writing
`x(P)`

and `y(P)`

respectively.

Even though points and vectors/matrices are represented in different ways, you can multiply a matrix with a point.

by Malin Christersson under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden License