Strains are measures of deformation gradients where the tensorial strain components in a coordinate system $x,y,z$ is expressed as:
\begin{equation} \begin{aligned} &\varepsilon_{xx}=\frac{du}{dx} && \varepsilon_{yy}=\frac{dv}{dy} && \varepsilon_{zz}=\frac{dw}{dz} \\ &\varepsilon_{xy}=\frac{1}{2}\big(\frac{du}{dy}+\frac{dv}{dx}\big) && \varepsilon_{xz}=\frac{1}{2}\big(\frac{du}{dz}+\frac{dw}{dx}\big) && \varepsilon_{yz}=\frac{1}{2}\big(\frac{dv}{dz}+\frac{dw}{dy}\big) \end{aligned} \tag{1} \end{equation}where $u,v$ and $w$ are displacements in $x,y$ and $z$ directions.
The strain tensor written as a matrix is:
\begin{equation} \boldsymbol{\varepsilon}= \begin{bmatrix} \varepsilon_{xx} & \varepsilon_{xy} & \varepsilon_{xz} \\ \varepsilon_{xy} & \varepsilon_{yy} & \varepsilon_{yz} \\ \varepsilon_{xz} & \varepsilon_{yz} & \varepsilon_{zz} \end{bmatrix} \tag{2} \end{equation}Observe that the strain tensor is symmetric and consists of 6 independent components.
We will generally be using engineering strains in this course, and introduce $\gamma_{ij}$ as notation for engineering shear strains and a reduced index notation for normal enginnering strains (i.e., $\varepsilon_{ii}=\varepsilon_i$). The relation between engineering strains and tensorial strains are
\begin{equation} \begin{bmatrix} \varepsilon_{x} & \gamma_{xy} & \gamma_{xz} \\ \gamma_{xy} & \varepsilon_{y} & \gamma_{yz} \\ \gamma_{xz} & \gamma_{yz} & \varepsilon_{z} \end{bmatrix}= \begin{bmatrix} \varepsilon_{xx} & 2\varepsilon_{xy} & 2\varepsilon_{xz} \\ 2\varepsilon_{xy} & \varepsilon_{yy} & 2\varepsilon_{yz} \\ 2\varepsilon_{xz} & 2\varepsilon_{yz} & \varepsilon_{zz} \end{bmatrix} \tag{3} \end{equation}Hence, the engineering strains expressed by displacements $u,v$ and $w$ in in the $x,y$ and $z$ directions become
\begin{equation} \begin{aligned} &\varepsilon_x=\frac{du}{dx} && \varepsilon_y=\frac{dv}{dy} && \varepsilon_z=\frac{dw}{dz} \\ &\gamma_{xy}=\frac{du}{dy}+\frac{dv}{dx} && \gamma_{xz}=\frac{du}{dz}+\frac{dw}{dx} && \gamma_{yz}=\frac{dv}{dz}+\frac{dw}{dy} \end{aligned} \tag{4} \end{equation}Consider a linear displacement field representing a plane strain case ($ \varepsilon_z = \gamma_{xz} = \gamma_{yz} = 0 $):
\begin{aligned} &u(x,y,z) = c_1 x + c_2 y \\ &v(x,y,z) = c_3 x + c_4 y \\ &w(x,y,z) = 0 \end{aligned}Then,
\begin{aligned} &\varepsilon_x=\frac{du}{dx}=c_1 && \varepsilon_y=\frac{dv}{dy}=c_4 && \varepsilon_z=\frac{dw}{dz}=0\\ &\gamma_{xy}=\frac{du}{dy}+\frac{dv}{dx}=c_2+c_3 && \gamma_{xz}=\frac{du}{dz}+\frac{dw}{dx}=0 && \gamma_{yz}=\frac{dv}{dz}+\frac{dw}{dy}=0 \end{aligned}Hence,
\begin{aligned} &u = \varepsilon_x x + \frac{1}{2}\gamma_{xy} y \\ &v = \frac{1}{2}\gamma_{xy} x + \varepsilon_y y \\ &w = 0 \end{aligned}Illustrations (the source code of the function is found in the Plot gallery):
from plotlib import illustrateStrains
%matplotlib inline
illustrateStrains( ex=0.003, ey=-0.001, exy=0, scaleFactor=100)
illustrateStrains( ex=0, ey=0, exy=0.003, scaleFactor=100)
illustrateStrains(ex=0.005, ey=-0.002, exy=-0.002, scaleFactor=100)