\documentclass[11pt]{article}
\usepackage{fleqn}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{epsfig}
\usepackage{makeidx}
% if you want to include PostScript figures
\usepackage{graphicx}



%\textheight= 8in
%\textwidth=8in
\parindent =0pt
%\voffset = -1 in
%\hoffset= -1 in
\parindent = 0pt
\parskip = 6pt
\tolerance = 10000



\parskip 12pt
\parindent 0pt

\def\pp{{\bf p}}
\def\qq{{\bf q}}
\def\rr{{\bf r}}
\def\vv{{\bf v}}
\def\ww{{\bf w}}
\def\uu{{\bf u}}
%\def\eee1{{\bf e}_1}
%\def\eee2{{\bf e}_2}

\def\bef{\begin{figure}[t]}
\def\eef{\end{figure}}

% ===========================================================

\title{Notation, Point \& Vector Basics \\
Introduction to Computer Graphics \\
Arizona State University}

\author{Dianne Hansford }
\date{\today}



\begin{document}

\maketitle




\section{Notation}



Let's focus on 2D. After that, 3D is easy!

The $[{\bf e}_1,{\bf e}_2]$-coordinate system is defined by the origin ${\bf o}$, and
the ${\bf e}_1$ and ${\bf e}_2$ vectors:
$$
{\bf o} = \begin{bmatrix} 0 \\ 0\end{bmatrix}, \quad
{\bf e}_1 = \begin{bmatrix} 1 \\ 0\end{bmatrix}, \quad
{\bf e}_2 = \begin{bmatrix} 0 \\ 1\end{bmatrix}.
$$

A {\em point} $\pp$ describes a location and its coordinates are defined as
$$
\pp = \begin{bmatrix} p_1 \\ p_2\end{bmatrix}.
$$
Therefore, a point's location is defined by its coordinates in this coordinate system: $\pp = {\bf o} + p_1{\bf e}_1 + p_2{\bf e}_2$.
Sometimes it is convenient to label the coordintes of $\pp$ as $p_x$ and $p_y$.

A {\em vector} $\vv$ describes a  displacement (direction and distance) and
its components take the form
$$
\vv = \begin{bmatrix} v_1 \\ v_2\end{bmatrix},
$$
and thus $\vv = v_1{\bf e}_1 + v_2{\bf e}_2$.
Figure \ref{fig:point_vector} illustrates this basic geometry.
\bef
  \begin{center}
  \epsfig{file=../figures/point_vector.ps,height=2in}
  \end{center}
  \caption{Point and vector notation.}
  \label{fig:point_vector}
\eef






\section{Point and Vector Combinations}

As illustrated in Figure \ref{fig:point-plus-vector}, the sum of a point and a vector is a point:
\begin{equation}
\qq = \pp + \vv. \label{eq:pt-vec-sum}
\end{equation}
\bef
  \begin{center}
  \epsfig{file=../figures/pandv.ps,height=2in}
  \end{center}
  \caption{The sum of a point and vector yields a point.}
  \label{fig:point-plus-vector}
\eef

Vector addition may be described in terms of the {\em parallelogram rule}, as illustrated in
Figure \ref{fig:parallelogram_rule}. Therefore, any scalar values $s$ and $t$ are acceptable
in forming $\uu = s\vv + t\ww$.
\bef
  \begin{center}
  \epsfig{file=../figures/pgramrule.ps,height=2in}
  \end{center}
  \caption{The parallelogram rule encapsulates vector addition.}
  \label{fig:parallelogram_rule}
\eef

To formulate point addition, let's revisit (\ref{eq:pt-vec-sum}) and the idea that a
point plus a vector results in a point. As in Figure \ref{fig:sum-of-points2},
we may form a point on the line through $\pp$ and $\qq$ as
\begin{align}
\rr &= \pp + t\vv \\
    &= \pp + t(\qq - \pp) \\
    &= (1-t)\pp + t\qq, \label{eq:linear_interpolation}
\end{align}
therefore, the coefficients for point addition must sum to one. Such a requirement on the coefficients is called a {\em barycentric combination}. Another name for (\ref{eq:linear_interpolation}) is {\em linear interpolation}. Notice that when the {\em parameter} $t=0$, $\rr=\pp$, when $t=1$, $\rr=\qq$, and when $t=1/2$, $\rr$ is the midpoint between $\pp$ and $\qq$.
\bef
  \begin{center}
  \epsfig{file=../figures/pqr.ps,height=2in}
  \end{center}
  \caption{The operation $\rr = (1-t)\pp + t\qq$
           results in a point on the line defined by $\pp$ and $\qq$.}
  \label{fig:sum-of-points2}
\eef


Thus we see that the relative positioning of $\pp, \qq, \rr$
may be characterized by the parameter
$$
t = \frac{||\rr-\pp||}{||\pp-\qq||},
$$
using a signed distance, as illustrated in Figure \ref{fig:paramt}.
The relationship between the three points is also reflected in the quotient
$$
\textrm{ratio}(\pp,\qq, \rr) = \frac{t}{1-t} = \frac{||\rr-\pp||}{||\qq-\rr||},
$$
and this ratio is also illustrated in Figure \ref{fig:paramt}.

\bef
  \begin{center}
  \epsfig{file=../figures/paramt.ps,height=2in}
  \end{center}
  \caption{Examples of the ratio of three points and the corresponding parameter $t$.}
  \label{fig:paramt}
\eef


Point addition comes with some rules for two reasons.
\begin{enumerate}
\item We would like coordinate-system independent operations. For example, as illustrated in Figure \ref{fig:sum-of-points}, averaging two points should always yield the same point.
\item We want a method to construct a new point within the confines of the geometry defined by the given points. For example, as illustrated in Figure \ref{fig:sum-of-points2}, we would like to construct a point on the line defined by $\pp$ and $\qq$.
\end{enumerate}

\bef
  \begin{center}
  \epsfig{file=../figures/pointsum.ps,height=2in}
  \end{center}
  \caption{The result of the operation $\rr = \pp + \qq$
            is dependent on the coordinate system.}
  \label{fig:sum-of-points}
\eef






For more information, examples, and exercises, see {\bf Practical
Linear Algebra -- A Geometry Toolbox by G. Farin \& D. Hansford, A K
Peters, 2005}.


\end{document}
