\documentclass[12pt]{article}

\usepackage{pstricks}
\usepackage{amsmath,amsfonts,tikz}

% Put these before fancyhdr lest the headers and footers be the wrong length.
\textwidth = 6.5in   % 1in margins all around.
\hoffset = 0in       % These keep left margins at 1in.
\oddsidemargin = 0in
% So that there is one-half inch at top and bottom.
% See Math Into LaTeX, p. 260.
\topmargin = 0pt
\voffset = -0.5in
\textheight = 8.85in

\usepackage{fancyhdr}
\pagestyle{fancy}

\lhead{Mathematics and Digital Art}
\chead{}
\rhead{Due:  18 September 2017}
\lfoot{Matsko}
\cfoot{}
\rfoot{15 September 2017}

\renewcommand{\headrulewidth}{0pt}

\def\dint{\displaystyle\int}

\parskip=\bigskipamount
\parindent=0pt

\def\banner#1{\hrule\begin{center}{\sc #1}\end{center}\bigskip\hrule}

\def\reals{{\mathbb R}}
\def\nat{{\mathbb N}}

\def\pvec#1#2{\left(\begin{matrix}#1\cr#2\end{matrix}\right)}
\def\pvectd#1#2#3{\left(\begin{matrix}#1\cr#2\cr#3\end{matrix}\right)}
\def\bmatrix#1#2#3#4{
\left[\begin{matrix}#1&#2\cr #3&#4\end{matrix}\right]
}
\def\bmatrixtd#1#2#3#4#5#6#7#8#9{
\left[\begin{matrix}#1&#2&#3\cr #4&#5&#6\cr#7&#8&#9\end{matrix}\right]
}


\begin{document}


For problems \#1 and \#2, write the transformation which takes the unit square (blue) to the transformed square (red).  Use the form
$$T\pvec xy=\bmatrix abcd\pvec xy+\pvec ef.$$ Check your work online!  For \#3 and \#4, sketch a diagram of the unit square (blue) and the parallelogram it transforms into (red, possibly shaded if there is a flip).  Also, check your work algebraically (using matrix multiplication) like we did in class today.  Finally, check online using the Sage worksheet.

\begin{enumerate}

\item
\begin{tikzpicture}[scale=0.7]
\draw[gray] (-2,-4) grid (4,2);
\draw[<->,dashed] (-2.5,0) -- (4.5,0);
\draw[<->,dashed] (0,2.5) -- (0,-4.5);
\draw[very thick,blue] (0,0) -- (1,0) -- (1,1) -- (0,1) -- cycle;
\filldraw[very thick,red,fill=red!40!white] (3,-3) -- (1,-3) -- (-1,-1) -- (1,-1) -- cycle;
\filldraw (0,0) circle (0.1cm);
\draw (1,0) circle (0.1cm);
\filldraw (3,-3) circle (0.1cm);
\draw (1,-3) circle (0.1cm);
\end{tikzpicture}

\item
\begin{tikzpicture}[scale=0.7]
\draw[gray] (-4,-4) grid (2,6);
\draw[<->,dashed] (-4.5,0) -- (2.5,0);
\draw[<->,dashed] (0,6.5) -- (0,-4.5);
\draw[very thick,blue] (0,0) -- (1,0) -- (1,1) -- (0,1) -- cycle;
\draw[very thick,red] (-3,-3) -- (-3,5) -- (-1,5) -- (-1,-3) -- cycle;
\filldraw (0,0) circle (0.1cm);
\draw (1,0) circle (0.1cm);
\filldraw (-1,5) circle (0.1cm);
\draw (-3,5) circle (0.1cm);
\end{tikzpicture}

\item $$T\pvec xy=\bmatrix {-2}{0}{-1}2\pvec xy+\pvec {2}{-3}.$$

\item $$T\pvec xy=\bmatrix 0{-2}31\pvec xy+\pvec {1}{-2}.$$

\end{enumerate}


\end{document}

