Vous êtes sur la page 1sur 7

Lecture 2

Basic Elements
2.1

Vectors

Vectors are versatile mathematical containers for quite a number of things: a collection of numbers, directions, and all kinds of physical quantities that, in addition to
magnitude, also require information about direction and orientation (e.g. velocities and
forces).

Vectors

Whereas scalars are represented by a single number (e.g. pressure in a fluid) vectors
need a series of numbers. Most of the vectors we are dealing with have two, three and
sometimes four components called coordinates.


v1
v =
v2

x
r = y
(2.1)
z
The coordinates represent instructions on how to move in space: move x units in the
direction of the first basis vector, y units in the direction of the second basis vector, and
z units in the direction of the third basis vector. As a result, we moved in the direction
the vector is pointing and covered a linear distance equal to the vectors length.

Coordinates

Operations with vectors have been discussed in the mathematical primer.

2.2

Coordinate systems

to be completed; see handwritten notes for now

2.3

Explicit, implicit and parametric functions

to be completed; see handwritten notes for now

2.4

Points

Now to a somewhat confusing topic. In geometric modeling (and mathematics) a clear


2.1

Points

Lecture 2 Basic Elements

2.2

distinction is made between points and vectors.


Points represent absolute positions in space. A point has no direction and no
length.
Vectors can be defined by an ordered set of two points. A vector v starts at a
point P and ends at a point Q. Thus the vector has a direction and a length.
v = QP

(2.2)

The confusing part is that we use vectors to describe points. Both are defined by a set
of numbers we call coordinates or components. In the case of vectors, we discussed that
the coordinates determine direction and length. In the case of points, the coordinates
make only sense if there is an agreed upon origin. Be default, the origin is marked by
the point O = 0, 0, 0)T with all coordinates equal to zero.
The following example may help to illustrate the difference between points and vectors
(Fig. 2.1). Two points P and Q mark locations in a domain (Fig. 2.1(a)). In the
example, we choose a planar domain to simplify the illustration. Clearly the vector v
describes how to get from point P to point Q. Mathematically we can define the vector
as a difference between the points (see Fig. 2.1(b)).
v = QP

Points versus vectors


Points can be subtracted

(2.2)

In order to describe where P and Q are located, we define a coordinate system with
origin O1 . Now the points P and Q can be described with the vectors p1 = P O1 =
T
T
2, 3 and q 1 = Q O1 = 4, 2 (Fig. 2.1(c)). Since O1 has only coordinates equal
to zero, we often omit it. If we add the vectors, we obtain the vector r1 = p1 + q 1 . It
describes how to get from the origin to the point R1 (Fig. 2.1(d)).
If we choose another origin O2 the description for the points P and Q changes: p2 =
T
T
P O2 = 3, 0 and q 2 = Q O2 = 5, 1 (Fig. 2.1(e)). However the vector v is
still correctly represented by v = Q P . If you walk along v its whole length, you get
from point P to point Q:
Q = P +v
(2.3)
The addition of a point and a vector is a geometrically meaningful operation. It results
in a point.
However, if we add the vectors describing the points, we end up in completely different
locations depending on the choosen origin. Therefore, adding the points P and Q is a
meaningless geometric operation.

2.5

Points cannot be added

Barycentric combinations

Although simple addition does not apply to points, we still can combine points in
certain ways to define new points. A major role in modern CAD systems play so called
barycentric combinations of points.

NAME 4141, L. Birk

Combining points

rev140815

Lecture 2 Basic Elements

2.3

(a) Two points in a plain

(b) A vector v defined as a difference of two points

(c) In combination with an origin vectors can be


used to describe location of points

(d) Addition of points represented by vectors p1


and q 1 results in r1

(e) If we change the origin the vector v is still defined as the difference between points P and
Q

(f) Addition of points depends on origin and therefore is not a meaningful geometric operation

Fig. 2.1: Difference between points and vectors

NAME 4141, L. Birk

rev140815

Lecture 2 Basic Elements

2.4

Lets assume we have


a set of n + 1 points b0 , b1 , b2 , . . . , bn
and a set of real factors 0 , 1 , . . . , n (one factor for each point) with the following properties:
all factors are positive j 0
the factors add up to one

0 + 1 + 2 + . . . + n = 1
n
X
j = 1

(2.4)

j=0

Then a new point b can be created by barycentric combination of the points bj by


b =

n
X

j bj

j=0

= 0 b0 + 1 b1 + 2 b2 + . . . + n bn

(2.5)

This pretty much looks like summing up points which we said makes no sense. However,
if we take a closer look, we will see a major difference. From equation (2.4) follows

Barycentric combination
of points

0 = 1 1 2 . . . n
We substitute this for 0 in eq. (2.5) and re-organize the sums. Note, that we extracted
the first term of the sum and changed the range of the summation from j [0, n] to
j [1, n] accordingly.
b = 0 b0 +

n
X

j bj

j=1

1 1 2 . . . n b0 +

= b0 +
= b0 +
=

n
X
j=1
n
X

j=1
n
X

b0 +
|{z}
point

j b0 +

j=1

n
X

j bj

j=1

j bj

j=1

j bj j b0
j

n
X


bj b0
| {z }

(2.6)

vectors

It turns out, that the barycentric combination is not a summation of points but a sum
of a single point b0 plus a series of vectors (bj b0 ) (differences of points) which are
scaled by their factors j .
NAME 4141, L. Birk

rev140815

Lecture 2 Basic Elements

2.5

We discuss the concept of barycentric combinations in some detail because it is key in


understanding Bezier, B-spline and NURBS curves. The term barycentric is derived
from the Greek word barycenter which denotes the center of gravity of a body. The
center of gravity of a system of n masses mi is computed by summing up the mass
moments (mass distance from axis) divided by the sum of all masses. If the point bi
marks the center of gravity of mass mi the center of gravity of the system bg is given
by
bg =

Center of gravity

m0 b0 + m1 b1 + m2 b2 + + mn bn
m0 + m1 + m2 + . . . + mn
n
P
mi bi

i=0
n
P

mi

i=0

with M =

n
P

mi

i=0

n
1 X
mi bi
M
i=0

n
X
i=0

mi
b
M i

(2.7)

The factors i = mi /M associated with each point bi clearly satisfy the basic conditions
we impose on barycentric combinations: the factors are positive and add up to one.
mi
0
M

2.5.1

for all i = 0, 1, . . . , n

n
X
mi

i=0

= 1

(2.8)

Barycentric combination of two points

Lets apply the concept of barycentric combination to two points in a plane:

V0 =

b1

y1
1
2

y0 + y1

bm

y0

b0
x0

NAME 4141, L. Birk

1
2

x0 + x1

x1 x

x0
y0

V1 =

Straight line

x1
y1

The point V m in the middle of the straight


line connecting V 0 and V 1 has the coordinates
 
 1
x0 + x1
2
Vm =
1
2 y0 + y1
or short

Vm =

1
1
V + V1
2 0
2
rev140815

Lecture 2 Basic Elements

2.6

The factors 0 = 12 and 1 =


barycentric combination.

1
2

are positive and add up to one. Again, we have a

In order to describe all points on the straight line defined by the end points V 0 and
V 1 , we could define a linear function y = f (x) with f (x) = m(x x0 ) + c. m represents
the slope and c the yaxis part with
y1 y0
x1 x0
c = y0

m =

Explicit functions are not suited for geometric modeling. If the points are parallel to
the yaxis, i.e. x0 = x1 , the slope becomes infinite and the equation cannot be used
to define the line.
A better way to describe the straight line between V 0 and V 1 is to start at V 0 and
then move along the vector connecting the two points. Mathematically this results in

y
r(t) = V 0 + t V 1 V 0
(2.9)
V1

The parameter t [0, 1] defines the fraction of the distance between V 0 and V 1
that we travel to reach the point r(t). For
t = 12 we get as expected

4
3

r(t)

V0
1

1
1
r(t = ) = V 0 + (V 1 V 0 )
2
2
1
1
= V0 + V1 V0
2
2
1
1
= V0 + V1
2
2

For arbitrary parameter values t we get


r(t) = V 0 + t (V 1 V 0 )
= V 0 + tV 1 tV 0

t V1
= (1 t) V 0 + |{z}
| {z }
=
1
= 0

(2.10)

which is a barycentric combination of V 0 and V 1 as 0 + 1 = (1 t) + t = 1 for all t.


Eq. 2.10 represents the general parametric form of a straight line between two points.

NAME 4141, L. Birk

Basis functions

rev140815

Lecture 2 Basic Elements

2.7

The factors 0 and 1 have


become functions of the parameter t. Later we will call
them basis functions. Obviously the basis functions
are linear for this case. To
be more specific they are
polynomials of degree one,
meaning that the highest
power associated with the
variable of the polynomial
(here t) is equal to one.

i
1.0
0.8

0 (t)

1 (t)

0.6
0.4
0.2

0.2

0.4

0.6

0.8

1.0

0 (t) = (1 t)1 = 1 t1
1 (t) = t1

A polynomial of degree p is of order k = p + 1. Thus our linear polynomials with p = 1


are of order k = 2. The order reflects the number of coefficients in the polynomial:

Degree and order

The linear polynomial s(t) = a0 + a1 t has two coefficients a0 , a1 .


The polynomial s(t) = a0 + a1 t + a2 t2 is of degree p = 2 (because of t2 ) and of
order k = 3 because we have three coefficients a0 , a1 , a2 . Even if the coefficients
a0 (associated with t0 ) and a1 (associated with t1 ) would be zero the remaining
polynomial s(t) = a2 t2 would be considered to be of order k = 3. For a2 = 0
and a1 6= 0 the polynomial becomes linear.
Unfortunately, literature does not always make a clear distinction between degree and
order.

NAME 4141, L. Birk

rev140815

Vous aimerez peut-être aussi