# 77. Matrices¶

## 77.1. Introduction¶

Matrices are an important concept which has numerous real life usage in various mathematical branches. Also, it has huge importance in modern computer science. It has its applications in computer graphics, AI, data structures leading to various clever algorithms. Thus, it is of paramount importance that the reader understand this particular concept in a sound manner.

## 77.2. Definition¶

A matrix is a rectangular array of real or complex numbers. This rectangular array is made up of rows and columns much like determinants. Let us consider a matrix of $$m\times n$$ symbols, where $$m$$ is number of rows and $$n$$ is the number of columns.

$$A = \begin{bmatrix}a_{11} & a_{12} & \ldots & a_{1n} \\ a_{21} & a_{22} & \ldots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{m1} & a_{m2} & \ldots & a_{mn}\end{bmatrix}$$

Such a matrix is called $$m$$ by $$n$$ matrix or a matrix of order $$m\times n.$$ Sometimes a matrix is shown with parenthese instead of square brackets as shown in last example.

$$A = \begin{pmatrix}a_{11} & a_{12} & \ldots & a_{1n} \\ a_{21} & a_{22} & \ldots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{m1} & a_{m2} & \ldots & a_{mn}\end{pmatrix}$$

A compact way to write a matrix is $$A = [a_{ij}], 1\leq i \leq m; 1\leq j \leq n$$ or simply $$[a_{ij}]_{m\times n}$$

$$a_{ij}$$ is an element located at $$i^{th}$$ row and $$j^{th}$$ column and is called $$(i, j)^{th}$$ element of the matrix.

A matrix is just a rectangular array of numbers and unlike determinants it does not have a value.

### 77.2.1. Equal Matrices¶

Two matrices are said to be equal if they have same order and each corresponding element is equal.

## 77.3. Classification of Matrices¶

### 77.3.1. Row Matrix¶

A matrix having a single row is called a row matrix. For example, $$[1,2 3, 4]$$

### 77.3.2. Column Matrix¶

A matrix having a single column is called a coliuns matrix. For example,

$$\begin{bmatrix}1\\2\\3\\4\end{bmatrix}$$

### 77.3.3. Square Matrix¶

If $$m = n$$ i.e number of rows and columns are equal then the matrix is called a square matrix. For example,

$$\begin{bmatrix}1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9\end{bmatrix}$$ is a $$3\times 3$$ matrix.

### 77.3.4. Diagonal Matrix¶

The diagonal from left-hand side upper corner to right-hand side lower corner is known as leading diagonal or principal diagonal. In the example of square matrix the elements of diagonal are $$1, 5, 9$$

When a matrix has all elements as zero except those belonging to its diagonal thne it is called a diagonal matrix. Equivalently, We can say that a matrix $$[a_{ij}]_{m\times n}$$ is a diagonal matrix if $$a_{ij} = 0~\forall~i\neq j$$ For example, the square matrix example can be converted to a diagonal matrix like below:

$$\begin{bmatrix}1 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 9\end{bmatrix}$$

For an $$n\times n$$ matrix the diagonal elements are represented as $$[d_1, d_2 \ldots, d_n]$$ This diagonal is also written with a diag prefix like $$diag [d_1, d_2 \ldots, d_n]$$

### 77.3.5. Scalar Matrix¶

A diagonal matrix whose elements of the diagonal are equal is called scalar matrix. For example:

$$\begin{bmatrix}5 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 5\end{bmatrix}$$

For a square matrix $$[a_{ij}]_{m\times n}$$ to be a scalar matrix

$$a_{ij} = \begin{cases}0, & i\neq j \\ m,& i = j\end{cases}~\forall~m\neq 0$$

### 77.3.6. Unit Matrix or Identity Matrix¶

A diagonal matrix of order $$n,$$ which has all elements of its diagonal as one, is called a unit or identity matrix. It is also denoted by $$I_n$$

We can rewrite it in concise way like we did for scalar matrix as

$$a_{ij} = \begin{cases}0, & i\neq j \\ 1,& i = j\end{cases}$$

### 77.3.7. Horizontal Matrix¶

An $$m\times n$$ matrix is called a horizontal matrix if $$m < n.$$ For example:

$$\begin{bmatrix}1 & 2 & 3\\4 & 5 & 6\end{bmatrix}$$

### 77.3.8. Vertical Matrix¶

An $$m\times n$$ matrix is called a vertical matrix if $$m > n.$$ For example:

$$\begin{bmatrix}1 & 2 \\ 3 & 4 \\ 5 & 6\end{bmatrix}$$

### 77.3.9. Triangular Matrix¶

A sqaure matrix in which all the elements below the diagonal are zero is called upper triangular matrix. Conversely, a sqaure matrix in which all the elements above the diagonal matrix is called lower triangular matrix. Thus, for a lower triangular matrix $$a_{ij} = 0$$ when $$i < j$$ and for an upper triangular matrix $$a_{ij} = 0$$ when $$i > j$$

Clearly, a diagonal matrix is both lower and upper triangular matrix. A triangular matrix is called strictly triangular if $$a_{ii} = 0~\forall~1\leq i \leq n$$

Example of upper triangular matrix:

$$\begin{bmatrix}1 & 2 & 3\\0 & 5 & 6\\0 & 0 & 9\end{bmatrix}$$

Example of lower triangular matrix:

$$\begin{bmatrix}1 & 0 & 0\\4 & 5 & 0\\7 & 8 & 9\end{bmatrix}$$

### 77.3.10. Null or Zero Matrix¶

If all elements of a matrix is zero then it is a null or zero matrix.

### 77.3.11. Trace of Matrix¶

If sum of the elements of a sqaure matrix $$A$$ lying along the principal diagonal is called the trace of $$A,$$ i.e. $$tr(A).$$ Thus, if $$A = [a_{ij}]_{n\times n},$$ then

$$tr(A) = \sum_{i = 1}^n a_{ii}$$

#### 77.3.11.1. Properties of Trace of a Matrix¶

To prove the second and third properties of a trace of matrix we will have to use properties given further below on algebraic operations on a matrix.

If $$A = [a_{ii}]_{n\times n}$$ and $$B = [b_{ii}]_{n\times n}$$ and $$\lambda$$ is a scalar then

1. $$tr(\lambda A) = \lambda tr(A)$$

2. $$tr(A + B) = tr(A) + tr(B)$$

3. $$tr(AB) = tr(BA)$$

### 77.3.12. Determinant of a Matrix¶

Every square matrix $$A$$ has a determinant associated with it. This is written as $$det(A)$$ or $$|A|$$ or $$\Delta$$

Notes:

• If $$A_1, A_2, \ldots, A_n$$ are square matrices of the same order then $$|A_1A_2\ldots A_n| = |A_1||A_2|\ldots|A_n|$$

• If $$k$$ is a scalar, then $$|kA| = k^n|A|,$$ where $$n$$ is the order of matrix.

• If $$A$$ and $$B$$ are two matrices of equal order then $$|AB| = |BA|$$ even though $$AB\neq BA$$

### 77.3.13. Singular and Non-Singular Matrix¶

A matrix is said to be non-singular if $$|A|\neq 0$$ and singular if $$|A| = 0$$

## 77.4. Algebra of Matrices¶

If any two matrices are of same order then addition of those can be performed. The result is a matrix of same order with corresponding elements added. For example, consider two $$3\times 3$$ matrices as given below:

$$A = \begin{bmatrix}a_1 & a_2 & a_3\\a_4 & a_5 & a_6\\a_7 & a_8 & a_9\end{bmatrix}, B = \begin{bmatrix}b_1 & b_2 & b_3\\b_4 & b_5 & b_6\\b_7 & b_8 & b_9\end{bmatrix}$$

then,

$$A + B = \begin{bmatrix}a_1 + b_1 & a_2 + b_2 & a_3 + b_3\\a_4 + b_4 & a_5 + b_5 & a_6 + b_6\\a_7 + b_7 & a_8 + b_8 & a_9 + b_9\end{bmatrix}$$

### 77.4.2. Subtraction of Matrices¶

The conditions are same for subtraction to happen i.e. order of the matrices must be same. The result is like that of addition with resulting elements being the difference of original matrices. For example,

$$A - B = \begin{bmatrix}a_1 - b_1 & a_2 - b_2 & a_3 - b_3\\a_4 - b_4 & a_5 - b_5 & a_6 - b_6\\a_7 - b_7 & a_8 - b_8 & a_9 - b_9\end{bmatrix}$$

where $$A$$ and $$B$$ are matrices from previous example.

Note:

• Addition of matrices is commutative i.e. $$A + B = B + A$$ as well as associative i.e. $$(A + B) + C = A + (B + C)$$

• Cancellation laws are true in case of addition.

• The equation $$A + B = O$$ has a unique solution in the set of all $$m\times n$$ matrices(where $$O$$ is null matrix)

### 77.4.3. Scalar Multiplication¶

The scalar multiplication of a matrix $$A$$ with a scalar $$\lambda$$ is defined as $$\lambda A = [\lambda a_{ij}]$$

### 77.4.4. Multiplication of two Matrices¶

The prerequisite for matrix multiplication is that number of columns of first matrix must be equal to number of rows of second matrix. The product is defined as

$$A_{m\times n}B_{n\times p} = \sum_{r = 1}^na_{mr}b_{rp}$$

As you can clearly examine the resulting matrix will have $$m$$ rows and $$p$$ columns.

#### 77.4.4.1. Properties of Matrix Multiplication¶

• Commutative laws does not hold always for matrices

• If $$AB = BA,$$ then they are called commutative matrices

• If $$AB = -BA,$$ then they are called anti-commutative matrices

• Matrix multiplication is associative i.e. $$(AB)C = A(BC)$$ Proof of this has been left as an exercise.

• Matrix mulplication is distributive wrt addition and subtraction i.e. $$A(B\pm C) = AB \pm AC$$

### 77.4.5. Transpose of a Matrix¶

Let $$A$$ be any matrix then its transpose can be obtained by ecxchanging rows and columns. It is denoted by $$A'$$ or $$A^T$$ and clearly, if order of $$A$$ is $$m\times n$$ then $$A'$$ will have order of $$n\times m$$

#### 77.4.5.1. Properties of Transpose Matrices¶

• $$(A + B)' = A' + B'$$

• $$(A')' = A$$

• $$(kA)' = kA'$$ where $$k$$ is a constant.

• $$(AB)' = B'A'$$

Proofs of these properties are simple and have been left as an exercise.

### 77.4.6. Symmetric Matrix¶

A sqaure matrix $$A = [a_{ij}]$$ is called a symmetric matrix if $$a_{ij} = a_{ji}~\forall~i,j$$

We can also say thet a matrix is symmetric if and only if $$A = A'$$

### 77.4.7. Skew Symmetric Matrix¶

A square matrix $$A$$ is said to be a skew symmetric matrix if $$a_{ij} = -a_{ji}~\forall i, j$$

Clearly, if a matrix is skew symmetric then elements of its diagonal are all zeros.

### 77.4.8. Orthogonal Matrix¶

A matrix is said to be orthogonal if $$AA'=1$$.

Notes:

• If $$A$$ is a square matrix then $$A + A'$$ is a symmetric matrix and $$A-A'$$ is a skew symmetric matrix.

Proof:

$$(A + A')' = A' + (A')' = A' + A$$

Hence, $$A + A'$$ is a symmetric matrix.

$$(A - A')' = A' - A = -(A - A')$$

Hence, $$A- A'$$ is a skew symmetric matrix.

• Every square matrix can be shown as sum of a symetric matrix and a skew symmetric matrix.

Proof:

Let $$A$$ be any square matrix.

$$\frac{1}{2}(A + A') + \frac{1}{2}(A - A') = A$$

Thus, the matrix $$A$$ is a sum of symmetrix matrix $$A + A'$$ and a skew symmetric matrix $$A - A'$$

### 77.4.9. Adjoint of a Matrix¶

Let $$A= [a_{ij}]$$ be a square matrix.

Let $$B = [A_{ij}]$$ where $$A_{ij}$$ is the cofactor of the element $$a_{ij}$$ in the det. $$A$$. The transpose $$B'$$ of the matrix $$B$$ is called the adjoint of the matrix $$A$$ and is written by $$adj. A.$$ For example,

Let $$A = \begin{bmatrix}1 & 2& 5\\2 & 3 & 4\\2& 0 & 5\end{bmatrix},$$ then $$B = \begin{bmatrix}15 & -2 & -6\\-10 & -1 & 4\\-1 & 2 & -1\end{bmatrix}$$

$$adj. A = B' = \begin{bmatrix}15& -10 & -1\\-2 & -1 & 2\\-6 & -4 & -1\end{bmatrix}$$

• $$A.adj(A) = adj(A).A = |A|I_n$$

### 77.4.10. Inverse of a Matrix¶

Following from above, inverse of a matrix is $$\frac{adj(A)}{|A|}$$

### 77.4.11. Hermitian and Skew Hermitian Matrix¶

A sqaure matrix $$A = [a_{ij}]$$ is said to be a Hermitian matrix if $$a_{ij} = \overline{a_{ij}}~\forall~i, j$$ i.e. $$A = A^{\theta}$$. For example,

$$\begin{bmatrix}a & b += ic \\ b - ic & d\end{bmatrix}$$ is a Hermitian matrix.

Similarly, a sqaure matrix $$A = [a_{ij}]$$ is said to be a skew Hermitian matrix if $$a_{ij} = \overline{a_{ji}}~\forall~i, j$$ i.e. $$A = -A^{\theta}$$. For example,

$$\begin{bmatrix}0 & -b + ic \\ b + ic & 0\end{bmatrix}$$ is a skew Hermitian matrix.

Notes:

1. If $$A$$ is a hermitian matrix, then $$a_{ii} = \overline{a_{ii}} \Rightarrow a_{ii}$$ is real, $$\forall~i.$$ Thus, members of diagonal of a Hermitian matrix are all real.

2. A Hermitian matrix over the set of real numbers is actually a real symmetric matrix.

3. If $$A$$ is a skew Hermitian matrix, then $$a_{ii} = -\overline{(a_{ii})} \Rightarrow a_{ii} = 0$$ i.e. $$a_{ii}$$ must be purely imaginary or zero.

4. A skew Hermitian matrix over the set of real numbers is acually a real skew-symmetric matrix.

### 77.4.12. Idempotent Matrix¶

A square matrix $$A$$ is said to be idempotent if $$A^2 = A$$ i.e. multiplication of the matrix with itself yields itself.

### 77.4.13. Involuntary Matrix¶

A sqaure matrix $$A$$ is said to be involuntary if $$A^2 = I$$ i.e. multiplication of the matrix with itself yields an indetity matrix.

### 77.4.14. Nilpotent Matrix¶

For a positive integer $$i$$ if a square matrix satisfied the relationship $$A^i = O$$ then it is called a nilpotent matrix. Such smallest integer is called index of the nilpotent matrix.

## 77.5. Properties of adjoint and inverse matrices¶

1. If $$A$$ is a sqaure matrix of order $$n,$$ then $$A(adj(A)) = |A|I_n = (adj(A))A$$

Proof: Let $$A= [a_{ij}],$$ and let $$C_{ij}$$ be a cofactor of $$a_{ij}$$ in $$A.$$ Then,

$$(adj(A)) = C_{ji}~\forall~1\leq i, j\leq n.$$ Now,

$$(A~adj(A)) = \sum_{r = 1}^n (A)_{ir}(adj(A))_{rj}$$

$$= \sum_{r = 1}^n a_{ir}C_{rj} = \begin{cases} |A|, & \text{if}~i = j \\ 0, & \text{if}~i \neq j\end{cases}$$

$$\Rightarrow = \begin{bmatrix} |A| & 0 & 0 & \ldots & 0 \\ 0 & |A| & 0 \ldots & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ 0 & 0 & 0 & \ldots & |A|\end{bmatrix}$$

$$= |A|I_n$$

Similarly, $$(adj(A) A)_{ij} = \sum_{r = 1}^n (adj(A))_{ir}A_{rj}$$

$$= \sum_{r = 1}^n C_{ri}a_{rj}= \begin{cases} |A|, & \text{if}~i = j \\ 0, & \text{if}~i \neq j\end{cases}$$

2. Every invertible matrix possesses a unique matrix.

Proof: Let $$A$$ be a sqaure matrix of order $$n\times n.$$ Let $$B$$ and $$C$$ be two inverses of $$A.$$ Then,

$$AB = BA = I_n$$ and $$AC = CA = I_n$$

Now, $$AB = I_n\Rightarrow C(AB) = CI_n\Rightarrow (CA)B=CI_n\Rightarrow I_nB = CI_n$$

$$\Rightarrow B = C$$

3. Reversal law: If $$A$$ and $$B$$ are invertible matrices of same oreder, then $$AB$$ is invertible and $$(AB)^{-1} = B^{-1}A^{-1}.$$ In general, if $$A,B, C, ...$$ are invertible matrices then $$(ABC\ldots)^n = \ldots C^{-1}B^{-1}A^{-1}$$

Proof: If the given matrices are invertible $$|A|\neq 0$$ and $$|B|\neq 0 \Rightarrow |A||B|\neq 0$$ Hence, $$AB$$ is an invertible matrix. Now,

$$(AB)(B^{-1}A^{-1}) = A(BB^{-1})A^{-1}$$ [by associativity]

$$= A(I_n)A^{-1} = AA^{-1} = I_n$$

Similarly, $$(B^{-1}A^{-1})(AB) = I_n$$

4. If $$A$$ is an invertible matrix, then $$A'$$ is also invertible and $$(A')^{-1} = (A^{-1})'$$

Proof: $$A$$ is an invertible matrix $$\therefore |A| \neq 0$$

$$\Rightarrow |A'|\neq 0 [\because |A'| = |A|]$$

Hence, $$A'$$ is also invertible. Now,

$$AA^{-1} = I_n = A^{-1}A$$

$$(AA^{-1})' = (A^{-1}A)'$$

$$(A^{-1})'A' = I_n = A'(A^{-1})'$$ [by reversal law for transpose]

$$\Rightarrow (A')^{-1} = (A^{-1})'$$ [by definition for inverse]

5. If $$A$$ is a non-singular square matrix of order $$n,$$ then $$|adj A| = |A|^{n - 1}$$

Proof: We have $$A(adj(A)) = |A|I_n$$

$$A(adj(A)) = \begin{bmatrix}|A| & 0 & 0 & \ldots & 0 \\ 0 & |A| & 0 & \ldots & 0 \\ \vdots & \vdots & \vdots \\ 0 & 0 & 0 & \ldots & |A|\end{bmatrix}$$

$$|A(adj(A))| = |A|^n$$

$$|adj(A)| = |A|^{n - 1}$$

6. Reversal law for adjoint: If $$A$$ and $$B$$ are non-singular sqaure matrices of the same order, then

$$adj(AB) = adj(B)adj(A)$$ using $$(AB)^{-1} = B^{-1}A^{-1}$$

7. If $$A$$ is an invertible square matrix, then $$adj(A') = (adj(a))'$$

8. If $$A$$ is a sqaure non-singular matrix, then $$adj(adj(A)) = A^{n - 2}A$$

Proof: We know that $$B(adj(B)) = |B|I_n$$ for every sqaure matrix of order $$n.$$ Replacing $$B$$ by $$adj(A),$$ we get

$$(adj(A))[adj(adj(A))] = |adj(A)|I_n = |A|^{n - 1}I_n$$

Multiplying both sides by $$A$$

$$(A~adj(A))[adj(adj(A))] = A\{|A|^{n - 1}I_n\}$$

$$|A|I_n (adj(adj(A))) = |A^{n - 1}|(AI_n)$$

$$adj(adj(A)) = |A^{n - 2}|A$$

9. If $$A$$ is a non-singular matrix then $$|A^{-1}| = = |A|^{-1}$$ i.e. $$|A^{-1}| = \frac{I}{A}$$

Proof: Since $$|A|\neq 0, \therefore AA^{-1} = I$$

$$|AA^{-1}| = |A|\Rightarrow |A||A^{-1}| = 1$$

10. Inverse of $$k^{th}$$ power of $$A$$ is $$k^{th}$$ power of the inverse of $$A$$.

## 77.6. Solution of Simultaneous Linear Equations¶

Consider the system of equations given below:

$$\begin{cases}a_{11}x_1 + a_{12}x_2 + \ldots + a_{1n} = b_1\\a_{21}x_1 + a_{22}x_2 + \ldots + a_{2n} = b_2\\\vdots\\a_{n1}x_1 + a_{n2}x_2 + \ldots + a_{nn} = b_n\end{cases}$$

Let $$A = \begin{bmatrix}a_{11} & a_{12} & \ldots &a_{1n}\\a_{21} & a_{22} & \ldots &a_{2n}\\\vdots & \vdots & \ldots & \vdots\\a_{n1} & a_{n2} & \ldots &a_{nn}\end{bmatrix}, X= \begin{bmatrix}x_1\\x_2\\\vdots\\x_n\end{bmatrix}, B = \begin{bmatrix}b_1 \\ b_2 \\ \ldots\\ b_n\end{bmatrix}$$

The system of equations can be written as $$AX = B\Rightarrow X=A^{-1}B$$

If $$|A|\neq 0,$$ the system of equations has only trivial solution and the number of solutions is finite.

If $$|A|=0,$$ the system of equations has non-trivial solution and the number of solutions is infintite.

If the number of equations is less than the number of unknonwns then it has non-trivial solutions.

## 77.7. Elementary Operations/Transformations of a Matrix¶

Following are elementary operations of a matrix:

1. The interchange of any two rows or columns.

2. The multiplication of any row or column with a non-zero number.

3. The addition to the elements of any row or columns the corresponding elements of any other row or column multiplied with any non-zero number.

Elementary operations are also called row or column operation.

### 77.7.1. Equivalent Matrices¶

If a matrix $$B$$ can be obtained from a matrix $$A$$ by elementary transformations, then they are called equivalent matrices and are written as $$A\text{~} B$$

### 77.7.2. Theorem 1¶

Every elementary row or column transformation of $$m\times n$$ matrix(not identiry matrix) can be obtained by pre-multiplcation or post-multiplication with the corresponding elementary matrix obtained from the identity matrix $$I_m(I_n)$$ by subjecting it to the same elementary row or column transformation.

### 77.7.3. Theorem 2¶

Let $$C = AB$$ be a product of two matrices. Any elementray row or column transformation of $$AB$$ can be obained by subjecting the pre-factor $$A$$ or post-factor $$B$$ to the same elementary row or column transformation.

### 77.7.4. Method of Finding Inverse of a Matrix by Elementary Transformation¶

Let $$A$$ be a non-singular matrix of order $$n$$. Then $$A$$ can be reduced to the identity matrix $$I_n$$ by a sequence of elementary transformations only. As we have discussed every elementary row transformation of a matrix is equivalent top pre-multiplication by the corresponding elementary matrix. Therefore, there exists elementary matrices $$E_1, E_2,\ldots, E_k$$ such that

$$(E_1,E_2,\ldots, E_k)A = I_n$$

$$(E_1,E_2,\ldots, E_k)AA^{-1} = I_nA^{-1}$$

$$(E_1,E_2,\ldots, E_k)I_n = A^{-1}$$

## 77.8. Echelon Form of a Matrix¶

A matrix is said to be in echelon form if

1. Every row of $$A$$ which has all its elements $$0,$$ occurs below row which has a non-zero element.

2. The first non-zero element in each non-zero row is $$1$$

3. The number of zeros before the first non-zero element in a row is less than the number of such zeros in the next row.

## 77.9. Rank of a Matrix¶

Let $$A$$ be a matrix of order $$m\times n.$$ If at least one of its minors of order $$r$$ is different from zero and all minors of order $$r + 1$$ are zero, then the number $$r$$ is called the rank of the matrix $$A$$ and is denoted by $$\rho(A).$$

Notes:

1. The rank of a zero matrix is zero and rank of an identity matrix of order $$n$$ is $$n$$

2. The rank of a non-singular matrix of order $$n$$ is $$n.$$

3. The rank of a matrix in echelon form is equal to the number of non-zero rows of the matrix.

## 77.10. Application of Matrices to Geometry or Computer Graphics¶

As said earlier matrices are very useful to represent many operaion in computer graphics or geometry. It will require some knowledge of coordinate geometry.

### 77.10.1. Reflection Matrix¶

Consider a point $$P(x, y)$$ and its reflection $$Q(x_1, y_1)$$ along x-axis.

This may be written as $$x_1 = x + 0; y_1 = 0 - y$$

This system of equation can be written in matrix form as

$$\begin{bmatrix}x_1\\y_1\end{bmatrix} = \begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix} \begin{bmatrix}x \\ y\end{bmatrix}$$

Thus the matrix $$\begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix}$$ is reflection matrix of a point along x-axis. Similarly, $$\begin{bmatrix}-1 & 0 \\ 0 & 1\end{bmatrix}$$ is reflection matrix along y-axis.

Similarly, the reflection matrix through origin is $$\begin{bmatrix}-1 & 0 \\ 0 & -1\end{bmatrix}$$

Similarly, reflection along the line $$y = x$$ is $$\begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix}$$

Similarly, reflection along the line $$y = x\tan\theta$$ is $$\begin{bmatrix}\cos 2\theta & \sin 2\theta \\ \sin 2\theta & -\cos 2\theta\end{bmatrix}$$

### 77.10.2. Rotation Through an Angle¶

The rotation matrix in such a form would be $$\begin{bmatrix}\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta\end{bmatrix}$$ for anti-clockwise rotation.