

\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\veca{{\mathbf a}}
\def\vecb{{\mathbf b}}
\def\vecc{{\mathbf c}}
\def\vecd{{\mathbf d}}
\def\vece{{\mathbf e}}
\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 \#5 ---
Due Tuesday, March 5, 4:00pm } \\
{ Hand in via Gradescope --- Use separate pages for each problem. }
\end{center}

\begin{description}
\item[1.] Why is it customary to use the same specular exponent for all
wavelengths?  What might a specular highlight look like if
different wavelengths had different specular exponents?

\item[2.] Let $\vecx=\langle0,0\rangle$,
$\vecy=\langle4,0\rangle$,
$\vecz = \langle5,3\rangle$, and
$\vecw = \langle0,2\rangle$, as shown in the figure.
For each of the following values of $\alpha$ and~$\beta$, what point is
obtained by bilinear interpolation?  Draw a copy of
the quadrilaterial, and show the approximate locations
of your answers. (The value $\alpha$ gives the right-to-left direction;
$\beta$ the bottom-to-top direction.)
\begin{itemize}
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\item[a.] $\alpha=1$ and $\beta=0$.
\item[b.] $\alpha=\frac13$ and $\beta=1$.
\item[c.] $\alpha=\frac12$ and $\beta=\frac14$.
\item[d.] $\alpha = \frac23$ and $\beta=\frac13$.
\end{itemize}

\begin{center}
\begin{pspicture}(-0.1,-0.5)(5.0,3.0)
\uput[180](0,0){$\vecx=\langle 0,0 \rangle$}
\uput[0](4,0){$\vecy=\langle 4,0 \rangle$}
\uput[0](5,3){$\vecz=\langle 5,3 \rangle$}
\uput[180](0,2){$\vecw=\langle 0,2 \rangle$}
\pspolygon(0,0)(4,0)(5,3)(0,2)
\pscircle*(0,0){0.06}
\pscircle*(4,0){0.06}
\pscircle*(5,3){0.06}
\pscircle*(0,2){0.06}
\end{pspicture}
\end{center}

\item[3.] A function $g:[0,1]\times[0,1]\rightarrow\RRR$
 is defined by setting
 $g(\langle 0,0 \rangle) = \langle 2,0,0 \rangle$,
 $g(\langle 1,0 \rangle) = \langle 0,1, 0 \rangle$,
 $g(\langle 0,1 \rangle) = \langle 0,2,4 \rangle$,
 $g(\langle 1,1 \rangle) = \langle 2,2,0 \rangle$,
 and then using {bilinear interpolation} to
 extend the domain of $g$ to the square $[0,1]\times[0,1]$.
 What is $g(\frac 14, 0)$?  $g(\frac 14, 1)$?
 $g(\frac 14, \frac 12)$?


\item[4.] Suppose a surface patch in~$\RRR$ is defined by bilinearly interpolating
from four vertices.  Derive the following formulas
for the partial derivatives of~$\vecu$:
\begin{eqnarray*}\label{BilinearDerivEq}
\frac{\partial \vecu}{\partial\alpha} &=&
        (1-\beta)(\vecy-\vecx) + \beta(\vecz-\vecw) \\[1ex]
\frac{\partial \vecu}{\partial\beta} &=&
        (1-\alpha)(\vecw-\vecx) + \alpha(\vecz-\vecy).\nonumber
\end{eqnarray*}
In addition, give the formula for the normal vector to
the patch at a point $\vecu=\vecu(\alpha,\beta)$.

\item[5.]
 This problem is about points in $\mathbb R^2$, and their homogeneous representations;
and how they act under linear coordinates.
Let
\[
\vecx = \langle 0,0,2 \rangle \hbox{~~~~and~~~~}
\vecy = \langle 4, 8, 4 \rangle
\]
be homogeneous representations for the following two vectors in~$\mathbb R^2$:
\[
\veca = \langle 0,0 \rangle \hbox{~~~~and~~~~}
\vecb = \langle 1,2 \rangle.
\]
\begin{itemize}
\item[(a)]
What point~$\vecu$ in~$\mathbb R^2$ is equal to $\frac 14 \veca + \frac34 \vecb$?
\item[(b)]
What point $\vecw$ in~$\mathbb R^2$ is represented by (in homogeneous representation)
$\frac 14 \vecx + \frac34 \vecy$?
\item[(c)] Give values $\alpha$ and $\beta$ so that 
$\alpha \vecx + \beta \vecy$ is an affine combination giving a
homogeneous representation of the point~$\vecu$
calculated in part~(a).
\end{itemize}

\end{description}

\end{document}




