Affine Geometry
Affine Geometry
Jehee Lee
Seoul National University
Geometric Programming
Point p
Point q
p = (x1, y1)
q = (x2, y2)
p = (x1, y1)
(x1+x2, y1+y2)
q = (x2, y2)
Origin
• Vector sum
– (x1, y1) and (x2, y2) are considered as vectors from the origin to p
and q, respectively.
If you select a different origin, …
p = (x1, y1)
(x1+x2, y1+y2)
q = (x2, y2)
Origin
• Affine space
– Superset of vector space
– Includes vectors, points, and related operations
Points and Vectors
Point p
u 0 , u1 , , u N V c0 u 0 c1 u1 c N u N V
Affine Spaces
• An affine space consists of
– Set of points, an associated vector space, and
– Two operations: the difference between two points
and the addition of a vector to a point
Coordinate-Free Geometric Operations
• Addition
• Subtraction
• Scalar multiplication
• Linear combination
• Affine combination
Addition
p+w
u+v v w
u
p
u + v is a vector p + w is a point
u, v, w : vectors
p, q : points
Subtraction
p p-w
u u-v p-q -w
v
q p
u, v, w : vectors
p, q : points
Scalar Multiplication
scalar • vector = vector
1 • point = point
0 • point = vector
c • point = (undefined) if (c≠0,1)
Linear Combination
• A linear space is spanned by a set of bases
– Any point in the space can be represented as a linear
combination of bases
c v
i 0
i i c0 v 0 c1 v1 c N v N v
Affine Combination
N
c p
i 0
i i c0p 0 c1p1 c N p N
N N
( ci )p 0 ci (p i p 0 )
i 0 i 1
Example
• (p + q) / 2 : midpoint of line pq
p (1 c1 c N )o c1 (o v1 ) c N (o v N )
(1 c1 c N )q 0 c1q1 c N q N
c0q 0 c1q1 c N q N
Summary
Matrix Representation
• Use an “extra” coordinate
– In 3-dimensional spaces
• Point : (x, y, z, 1)
• Vector : (x, y, z, 0)
• For example
(x1, y1, z1, 1) + (x2, y2, z2, 1) = (x1+x2, y1+y2, z1+z2, 2)
point point undefined
1
(1,0,0,1) (1,1,0,1) (2,1,0,2) (1, ,0,1)
2
2
(1,0,0,1) (2,2,0,2) (3,2,0,3) (1, ,0,1)
3
OpenGL Programming
• OpenGL ( gl ) is a common graphics library
which provides functions for drawings and
interactive input.
• OpenGL is accessible via C or C++ programs
• http://www.opengl.org