

\documentclass[12pt]{report}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{pstricks}

\hyphenpenalty 150 \exhyphenpenalty 150
\tolerance=3000 \relpenalty=4000 \binoppenalty=9999
\spaceskip=3.33333pt plus2.75000pt minus1.11111pt

\def\Reals{{\mathbb R}}
\def\RR{{\Reals^2}}
\def\RRR{{\Reals^3}}
\def\vecf{{\mathbf f}}
\def\veci{{\mathbf i}}
\def\vecj{{\mathbf j}}
\def\veck{{\mathbf k}}
\def\vecm{{\mathbf m}}
\def\vecn{{\mathbf n}}
\def\vecu{{\mathbf u}}
\def\vecv{{\mathbf v}}
\def\vecw{{\mathbf w}}
\def\vecx{{\mathbf x}}
\def\vecy{{\mathbf y}}
\def\vecz{{\mathbf z}}
\def\veczero{{\mathbf 0}}

\def\lerp{{\hbox{\sc Lerp}}}

\addtolength{\topmargin}{-1.0in}
\addtolength{\textheight}{1.0in}
\addtolength{\textwidth}{0.5in}

\begin{document}

\begin{center}
{\bf Math 155A --- Computer Graphics --- Winter 2019 } \\
{\bf Homework \#4 ---
Due Wednesday, February 27, 9:00pm } \\
{ Hand in via Gradescope --- Use separate pages for each problem. }
\end{center}

\begin{description}
\item[1.] Let $\vecx_1=\langle -1, 0 \rangle$ and $\vecx_2 = \langle 2,1 \rangle$.
Let $\alpha$~control the linear interpolation (and linear extrapolation)
from $\vecx_1$ to~$\vecx_2$ by $\lerp(\vecx_1,\vecx_2,\alpha)$.
\begin{itemize}
\item[(a)] What points are obtained with $\alpha$~equal to
$-2$, $-1$, $0$, $\frac1{10}$, $\frac13$, $\frac12$, $1$, $1\frac12$ and $2$?
What value of $\alpha$~gives the point $\langle 1, \frac 23 \rangle$?
The point $\langle 8,3 \rangle$?
Graph your answers.
\item[(b)] What point~$\vecu$ on the line containin
$\vecx_1$ and $\vecx_2$ is the closest
to the origin?  Find the value~$\alpha$
such that $\vecu = \lerp(\vecx_1,\vecx_2,\alpha)$.
\item[(c)] Suppose the values for
$f(\vecx_1) = -3$ and $f(\vecx_2)=3$ have been
set, and we wish to set other values for $f(\vecz)$
by linear interpolation/extrapolation.  What will this
set $f(\langle 1,\frac 23\rangle)$ equal to?
\end{itemize}
\item[2.] Let $\vecx = \langle 0,0 \rangle$,
$\vecy = \langle 2,3 \rangle$, and
$\vecz = \langle 3,1 \rangle$ in~$\RR$.  Determine the points represented by
the following sets of barycentric coordinates.
\begin{itemize}
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\item[a.] $\alpha=0$, $\beta=1$, $\gamma = 0$.
\item[b.] $\alpha=\frac23$, $\beta=\frac13$, $\gamma = 0$.
\item[c.] $\alpha=\frac13$, $\beta=\frac13$, $\gamma = \frac13$.
\item[d.] $\alpha=\frac45$, $\beta=\frac{1}{10}$, $\gamma = \frac1{10}$.
\item[e.] $\alpha=\frac43$, $\beta=\frac23$, $\gamma = -1$.
\end{itemize}
Graph your answers along
with the triangle formed by $\vecx$, $\vecy$, and $\vecz$.
\item[3.] Let, again, $\vecx = \langle 0,0 \rangle$,
$\vecy = \langle 2,3 \rangle$, and
$\vecz = \langle 3,1 \rangle$.  Determine the
barycentric coordinates of the following points:

\noindent
\parbox{2.in}{
\begin{itemize}
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\item[a.] $\vecu_1 = \langle 2,3 \rangle.$
\item[b.] $\vecu_2 = \langle 1\frac13,2 \rangle.$
\item[c.] $\vecu_3 = \langle \frac32,\frac32 \rangle.$
\item[d.] $\vecu_4 = \langle 1,0 \rangle.$
\end{itemize}}
\hspace*{3em}
\begin{pspicture}(-0.5,2.0)(3.5,4.0)
\uput[180](0,0){$\vecx$}
\uput[150](2,3){$\vecu_1=\vecy$}
\uput[0](3,1){$\vecz$}
\uput[150](1.3333,2){$\vecu_2$}
\uput[0](1.5,1.5){$\vecu_3$}
\uput[0](1,0){$\vecu_4$}
\pscircle*(0,0){0.07}
\pscircle*(2,3){0.07}
\pscircle*(3,1){0.07}
\pscircle*(1.3333,2){0.07} %u_2
\pscircle*(1.5,1.5){0.07} %u_3
\pscircle*(1,0){0.07} %u_4
\pspolygon(3,1)(0,0)(2,3)
\end{pspicture}

\end{description}

\end{document}




