CAGD-banner.gif
On-Line Geometric Modeling Notes
AFFINE COMBINATIONS,
BARYCENTRIC COORDINATES,
AND CONVEX COMBINATIONS


These notes discuss affine combinations of points, barycentric coordinates of points and vectors, convex combinations, convex sets, and the convex hull of a set of points.

pdficonsmall.gif For a pdf version of these notes look here.


Affine Combinations of Points

Points in an affine space are utilized to position ourselves within the space. The operations on the vectors of an affine space are numerous - addition, scalar multiplication, dot products, cross products - but the operations on the points are limited. In this section we discuss the basic operations on points - affine combinations.

Let $ {\bf P} _1$ and $ {\bf P} _2$ be points in an affine space. Consider the expression

$\displaystyle {\bf P} \: = \: {\bf P} _1 + t ( {\bf P} _2 - {\bf P} _1 )
$

This equation is meaningful, as $ {\bf P} _2 - {\bf P} _1$ is a vector, and thus so is $ t ( {\bf P} _2 - {\bf P} _1 )$. Therefore $ {\bf P} $ is the sum of a point and a vector which is again a point (see the notes on Points and Vectors. This point $ {\bf P} $ represents, in the affine space of two-dimensional points and vectors, a point on the line that passes through $ {\bf P} _1$ and $ {\bf P} _2$.

\includegraphics {figures/equation-of-a-line}

We note that if $ 0 \leq t \leq 1$ then $ {\bf P} $ is somewhere on the line segment joining $ {\bf P} _1$ and $ {\bf P} _2$.

This expression allows us to define a basic operation on points. We utilize the following notation

$\displaystyle {\bf P} = (1-t) {\bf P} _1 + t {\bf P} _2
$

to mean that $ {\bf P} $ is the point defined by

$\displaystyle {\bf P} \: = \: {\bf P} _1 + t ( {\bf P} _2 - {\bf P} _1 )
$

We can then define an affine combination of two points $ {\bf P} _1$ and $ {\bf P} _2$ to be

$\displaystyle {\bf P} \: = \: \alpha_1 {\bf P} _1 + \alpha_2 {\bf P} _2
$

where $ \alpha_1 + \alpha_2 = 1$. The form $ {\bf P} = (1-t) {\bf P} _1 + t
{\bf P} _2$ is shown to be an affine transformation by setting $ \alpha_2 =
t$.


We can generalize this to define an affine combination of an arbitrary number of points. If $ {\bf P} _1, {\bf P} _2, ..., {\bf P} _n$ are points and $ \alpha_1, \alpha_2, ..., \alpha_n$ are scalars such that $ \alpha_1+\alpha_2+\cdots+\alpha_n=1$, then

$\displaystyle \alpha_1 {\bf P} _1 +
\alpha_2 {\bf P} _2 +
\cdots +
\alpha_n {\bf P} _n
$

is defined to be the point

$\displaystyle {\bf P} _1 + \alpha_2 ( {\bf P} _2 - {\bf P} _1 ) + \cdots + \alpha_n ( {\bf P} _n - {\bf P} _1)
$


To construct an excellent example of an affine combination consider three points $ {\bf P} _1$, $ {\bf P} _2$ and $ {\bf P} _3$. A point $ {\bf P} $ defined by

$\displaystyle {\bf P} \: = \: \alpha_1 {\bf P} _1 + \alpha_2 {\bf P} _2 + \alpha_3 {\bf P} _3
$

where $ \alpha_1 + \alpha_2 + \alpha_3 = 1$, gives a point in the triangle $ \triangle {\bf P} _1 {\bf P} _2 {\bf P} _3$. We note that the definition of affine combination defines this point to be

$\displaystyle {\bf P} \: = \: {\bf P} _1 + \alpha_2 ( {\bf P} _2 - {\bf P} _1 ) + \alpha_3 ( {\bf P} _3 - {\bf P} _1)
$

The following illustration shows the point $ {\bf P} $ generated when $ \alpha_1 = \alpha_2 = \frac{1}{4}$ and $ \alpha_3 = \frac{1}{2}$.

\includegraphics {figures/affine-triangle}

In fact, it can be easily shown that if $ 0 \leq \alpha1,\alpha2,\alpha3 \leq 1$ then the point $ {\bf P} $ will be within (or on the boundary) of the triangle. If any $ \alpha_i$ is less than zero or greater than one, then the point will lie outside the triangle. If any $ \alpha_i$ is zero, then the point will lie on the boundary of the triangle.


Barycentric Coordinates

Given a frame $ ( {\vec v} _1, {\vec v} _2, ..., {\vec v} _n, {\bf O} )$ for an affine space $ {\cal A} $, we can write any point $ {\bf P} $ uniquely as

$\displaystyle {\bf P} \: = \: p_1 {\vec v} _1 + p_2 {\vec v} _2 + \cdots + p_n {\vec v} _n + {\bf O}
$

If we define points $ {\bf P} _i$ by

\begin{displaymath}\begin{aligned}{\bf P} _0 & = {\bf O} \\  {\bf P} _1 & = {\bf...
...dots \\  {\bf P} _n & = {\bf O} + {\vec v} _n \\  \end{aligned}\end{displaymath}

and define $ p_0$ to be

$\displaystyle p_0 \: = \: 1 - ( p_1 + p_2 + \cdots + p_n )
$

then we can see that $ {\bf P} $ can be equivalently written as

$\displaystyle {\bf P} = p_0 {\bf P} _0 + p_1 {\bf P} _1 + p_2 {\bf P} _2 + \cdots + p_n {\bf P} _n
$

where $ p_0 + p_1 + p_2 + \cdots + p_n = 1$

In this form, the values $ (p_0, p_1, p_2, ..., p_n)$ are called the barycentric coordinates of $ {\bf P} $ relative to the points $ ( {\bf P} _0, {\bf P} _1, {\bf P} _2, ..., {\bf P} _n)$

Vectors can also be expressed in barycentric form by letting

$\displaystyle u_0 \: = \: - ( u_1 + u_2 + \cdots + u_n )
$

Then we have

$\displaystyle {\vec u} = u_0 {\bf P} _0 + u_1 {\bf P} _1 + u_2 {\bf P} _2 + \cdots + u_n {\bf P} _n
$

where now we have that $ u_0 + u_1 + u_2 + \cdots + u_n = 0$.


To give a simple example of barycentric coordinates, consider two points $ {\bf P} _1$ and $ {\bf P} _2$ in the plane. If $ \alpha_1$ and $ \alpha_2$ are scalars such that $ \alpha_1+\alpha_2=1$, then the point $ {\bf P} $ defined by

$\displaystyle {\bf P} \: = \: \alpha_1 {\bf P} _1 + \alpha_2 {\bf P} _2
$

is a point on the line that passes through $ {\bf P} _1$ and $ {\bf P} _2$. If $ 0 \leq \alpha_1,\alpha_2 \leq 1$ then the point $ {\bf P} $ is on the line segment joining $ {\bf P} _1$ and $ {\bf P} _2$. The following figure shows an example of a line and three points $ {\bf P} $, $ {\bf Q} $ and $ {\bf R} $. These points were generated using the following $ \alpha$s:

\includegraphics {figures/barycentric-line}


To give a slightly more complex example of barycentric coordinates, consider three points $ {\bf P} _1$, $ {\bf P} _2$, $ {\bf P} _3$ in the plane. If $ \alpha_1$, $ \alpha_2$, $ \alpha_3$ are scalars such that $ \alpha_1+\alpha_2+\alpha_3=1$, then the point $ {\bf P} $ defined by

$\displaystyle {\bf P} \: = \: \alpha_1 {\bf P} _1 + \alpha_2 {\bf P} _2 + \alpha_3 {\bf P} _3
$

is a point on the plane of the triangle formed by $ {\bf P} _1$, $ {\bf P} _2$, $ {\bf P} _3$. The point is within the triangle $ \triangle {\bf P} _1 {\bf P} _2 {\bf P} _3$ if $ 0 \leq \alpha_1,\alpha_2,\alpha_3 \leq 1$. If any of the $ \alpha$'s is less than zero or greater than one, the point $ {\bf P} $ is outside the triangle. If any of the $ \alpha$'s is zero, we reduce to the example above and note that $ {\bf P} $ is on one of the lines joining the vertices of the triangle. The following figure shows an example of such a triangle and three points $ {\bf P} $, $ {\bf Q} $ and $ {\bf R} $, these points were calculated using the following $ \alpha$'s:

\includegraphics {figures/barycentric-triangle}


Thus barycentric coordinates are another method of introducing coordinates into an affine space. If the coordinates sum to one, they represent a point ; if the coordinates sum to zero, they represent a vector.

Convex Combinations

Given a set of points $ {\bf P} _0, {\bf P} _1, ..., {\bf P} _n$, we can form affine combinations of these points by selecting $ \alpha_0, \alpha_1, ...,
\alpha_n$, with $ \alpha_0 + \alpha_1 + \cdots + \alpha_n = 1$ and form the point

$\displaystyle {\bf P} \: = \:
\alpha_0 {\bf P} _0 +
\alpha_1 {\bf P} _1 +
\cdots +
\alpha_n {\bf P} _n
$

If each $ \alpha_i$ is such that $ 0 \leq \alpha_i \leq 1$, then the points $ {\bf P} $ is called a convex combination of the points $ {\bf P} _0, {\bf P} _1, ..., {\bf P} _n$.


To give a simple example of this, consider two points $ {\bf P} _0$ and $ {\bf P} _1$. Any point $ {\bf P} $ on the line passing through these two points can be written as $ {\bf P} = \alpha_0 {\bf P} _0 + \alpha_1 {\bf P} _1$ which is an affine combination of the two points. The points $ {\bf Q} $ and $ {\bf R} $ in the following figure are affine combinations of $ {\bf P} _0$ and $ {\bf P} _1$.

\includegraphics {figures/convex-line}

However, the point $ {\bf Q} $ is a convex combination, as $ 0 \leq \alpha_0, \alpha_1 \leq 1$, and any point on the line segment joining $ {\bf P} _0$ and $ {\bf P} _1$ can be written in this way.


Given any set of points, we say that the set is a convex set, if given any two points of the set, any convex combination of these two points is also in the set. The following figure illustrates both a convex set (on the left) and a non-convex set (on the right).

\includegraphics {figures/convex-set}

This concept is actually quite intuitive, in that if one can draw a straight line between two points of the set that is not completely contained within the set, the the set is non-convex.


The set of all points $ {\bf P} $ that can be written as convex combinations of $ {\bf P} _0, {\bf P} _1, ..., {\bf P} _n$ is called the convex hull of the points $ {\bf P} _0, {\bf P} _1, ..., {\bf P} _n$. This convex hull is the smallest convex set that contains the set of points $ {\bf P} _0, {\bf P} _1,
..., {\bf P} _n$. The following figure illustrates the convex hull of a set of six points:

\includegraphics {figures/convex-hull}

One of the six points does not contribute to the boundary of the convex hull. If one looked closely at the coordinates of the point, one would find that this point could be written as a convex combination of the other five.


Acknowledgement

Most of this material was adapted from Tony DeRose's wonderful treatment of affine spaces given in [1].


Bibliography

1
Tony DeRose.
Coordinate-free geometric programming.
Technical Report 89-09-16, Department of Computer Science and Engineering, University of Washington, Seattle, Washington, 1988.


\begin{singlespace}
\noindent
\footnotesize\bfseries All contents copyright (c) ...
...ment, University of California, Davis \\
All rights reserved.
\end{singlespace}


Ken Joy
2000-11-28