\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\section*{Problem 1}
\subsection*{Camera Setup}
Camera position: $\mathbf{e} = (5,3,4)$\\
Look-at point: $\mathbf{g} = (1,0,4)$\\
Up vector: $\mathbf{t} = \langle 1,1,0 \rangle$\\
FOV: $\theta = \pi/3$, Aspect: $a = 4/3$, Near: $n = 0.1$, Far: $f = 10$
\subsection*{Camera Coordinate System}
$$\mathbf{w} = \frac{\mathbf{e} - \mathbf{g}}{|\mathbf{e} - \mathbf{g}|} = \frac{(4,3,0)}{5} = \left(\frac{4}{5}, \frac{3}{5}, 0\right)$$
$$\mathbf{u} = \frac{\mathbf{t} \times \mathbf{w}}{|\mathbf{t} \times \mathbf{w}|} = \frac{(0,0,-1)}{1} = (0,0,-1)$$
$$\mathbf{v} = \mathbf{w} \times \mathbf{u} = \left(\frac{4}{5}, \frac{3}{5}, 0\right) \times (0,0,-1) = \left(-\frac{3}{5}, \frac{4}{5}, 0\right)$$
\subsection*{World to Camera Transform}
$$M = \begin{pmatrix}
0 & 0 & -1 & 0 \\
-\frac{3}{5} & \frac{4}{5} & 0 & 0 \\
\frac{4}{5} & \frac{3}{5} & 0 & -5 \\
0 & 0 & 0 & 1
\end{pmatrix}$$
\subsection*{Line Segment Endpoints in Camera Space}
Point $(0,0,0)$:
$$\begin{pmatrix} 0 \\ 0 \\ -1 \\ 1 \end{pmatrix} \quad \text{(camera coords)}$$
Point $(-2,-2,-2)$:
$$\begin{pmatrix} 2 \\ \frac{8}{5} \\ -3 \\ 1 \end{pmatrix} \quad \text{(camera coords)}$$
\subsection*{Clipping Against Near Plane}
Near plane: $z = -0.1$
Point 1: $z = -1 < -0.1$ (behind near plane)\\
Point 2: $z = -3 < -0.1$ (behind near plane)
Both endpoints are behind the near plane, so the line segment does not intersect the viewing volume.
\textbf{Answer: No projection exists on the near face.}
\section*{Problem 2}
\subsection*{Triangle Vertices}
$A = (0,0)$, $B = (0,4)$, $C = (5,1)$\\
Point $P = (5,1)$
\subsection*{Barycentric Coordinate System}
$$P = \alpha A + \beta B + \gamma C$$
$$\alpha + \beta + \gamma = 1$$
\subsection*{Setting Up Equations}
$$(5,1) = \alpha(0,0) + \beta(0,4) + \gamma(5,1)$$
$$5 = 5\gamma$$
$$1 = 4\beta + \gamma$$
$$\alpha + \beta + \gamma = 1$$
\subsection*{Solving}
From first equation: $\gamma = 1$\\
From second equation: $1 = 4\beta + 1 \Rightarrow \beta = 0$\\
From third equation: $\alpha = 1 - 0 - 1 = 0$
\textbf{Answer: Barycentric coordinates are $(\alpha, \beta, \gamma) = (0, 0, 1)$}
\end{document}