# CS488 - Introduction to Computer Graphics - Lecture 4

## Geometry

The course notes give you the axioms and theorems. In class, I will concentrate on ideas and algorithms.

#### Euclid and the Greeks

Of course, it's completely unfair to give the Greeks all the credit.

• Straightedge and compass.
• Congruence: two different triangles share a property called congruence.
• Felix Klein's Erlangen program. (circa 1870).

#### Descartes

Points are pairs (triples, etc)

• Connects geometry to algebra.
• Computers do algebra, not geometry.
• Distance is defined: more strongly than the compass!

Points morphed into vectors.

• By trying to define addition so that algebra works.
• Makes geometry challenging as an interpretation of algebra!

#### Vector Spaces, aka Linear Algebra.

We have some things that look like Descartes' points, though we don't know exactly what they are.

We can tell when they are equal

• v1 =1 v2 if and only if x1 = x2 and y1 = y2.

• v1 +1 v2 means (x1, y1) +1 (x2, y2) =1 (x1 + x2, y1 + y2)
• They are closed under addition.
• There is a zero element 01 =1 (0, 0)

Where addition is, multiplication cannot be far behind

• a *1 v =1(a * x, a * y ), called scalar multiplication.
• They are closed under scalar multiplication.
• There is a unit element 1; there is a zero element 0.
• Scalars must be a field.
• Scalar multiplication distributes over addition: a *1 ( v1 +1 v2 ) =1 a *1 v1 +1 a *1 v2.

What are these things? We want the geometrical interpretation.

• Descartes called them points, BUT they are not like points.

How?

• You can move them around, like
• derivatives
• position independent code.

We call them vectors.

Generators

• How few vectors can I use to create all of them?
• The number is the dimension.
• A set having that number, with appropriate weasel words, is a basis.

#### Affine Spaces

Intuition is that when I add an origin, O, vectors define points.

• Each point, P, can be - but is not - identified with the vector that joins it to the origin.
• P =2 O +2 v
• =2 and +2 are related to =1 as follows,
• First, P1 =2 O +2 v1 =2 P2 =2 O +2 v2 if and only if v1 =1 v2.
• Second, ( O +2 v1 ) +2 v2 =2 O +2 ( v1 +1 v2 )
• Define point subtraction
• v =1 P1 -2 P2 if and only if P1 =2 P2 +2 v

Generators

• A basis for the vectors, (v1, v2, ... ), plus one point, O.
• Package them together (v1, v2, ..., O).

#### Euclidean Space

An affine space plus a metric, d(P1, P2), that has translational invariance

• Metric is symmetric by definition
• also non-negative and obeying the triangle inequality.
• d(P1, P2) = d(P1 +2 v, P2 +2 v).

The familiar dot product (defined on vectors, Why?) is your baby.