# Matrices reflection and shear

Description of reflection and shear of matrices with examples

## Matrices geometry

Geometric operations, like rotating a position vector by a certain angle around some axis, can be achieved by multiplying the vector by an appropriate matrix. This page descript how such matrices are constructed.

## Matrix Reflection

We will consider a point $$P$$ with the coordinates $$(x, y)$$ in a two-dimensional space.

In the two dimensional space we draw the vector $$\displaystyle \left[\matrix{x \\y}\right]$$ as

The matrix below produces a reflection of the vector across the X-axis

$$\displaystyle \left[\matrix{1 & 0\\0 & -1}\right]$$

this results in the formula

$$\displaystyle \left[\matrix{x'\\y'}\right] = \left[\matrix{1 & 0\\0 & -1}\right] · \left[\matrix{x\\y}\right] =\left[\matrix{x\\-y}\right]$$

A 3-dimensional reflection of the $$Y$$ position is achieved by the following formula

$$\displaystyle \left[\matrix{x'\\y'\\z'}\right] = \left[\matrix{1 & 0&0 \\ 0 & -1&0 \\ 0 & 0 &1}\right] · \left[\matrix{x \\ y \\ z}\right] =\left[\matrix{x \\ -y \\ z}\right]$$

To produce reflections in the $$X$$ or $$Z$$ planes, place a negative sign on the corresponding diagonal elements of the unit matrix.

## Matrix Shear

The insertion of a non-zero element into a position outside the diagonal of the unit matrix produces a shear distortion of the position vector.

$$\displaystyle \left[\matrix{1 & 1.5\\ 0 &1}\right] · \left[\matrix{x\\y}\right]$$ corresponds to $$\displaystyle \left[\matrix{x'\\y'}\right] =\left[\matrix{1 &1.5\\0 & 1}\right] · \left[\matrix{4\\3}\right]= \left[\matrix{8.5\\3}\right]$$