You are on page 1of 17

GEOMETRIC MODELING

AND 2D
TRANSFORMATION
Lecture 2- Prof. Ehsan T Esfahani
Spring 2016

Mathematical background • Goal: Study of geometrical properties such as shape. properties of space. size. and positioning of CAD model By the end of this lecture(s) you should be able to perform the following 2D operations: .

volume.Definitions • Scalar (a): Numbers representing magnitude and quantities such as length. speed • Vectors (𝑽): Set of scalars [𝑣1 𝑣2 … 𝑣𝑛 ] representing both direction and magnitude • Points (P): Representation of location in space [𝑝1 𝑝2 … 𝑝𝑛 ] Scalar: Latin alphabets Points: (…) Vector: [ …] . area.

𝑈 = 𝑢2 → 𝑊 = 𝑉 + 𝑈 = 𝑣2 + 𝑢2 𝑢3 𝑣3 𝑣3 + 𝑢3 • Scalar Multiplication: α𝑣1 α𝑉 = α𝑣2 α𝑣3 𝑉 𝑈 𝑊 𝑉 𝛼𝑉. 𝛼 > 1 • Vector multiplications (dot and cross) • Operations on Points • Point-point subtraction results in a vector.Operations on points and vectors: • Vector operations • Addition: 𝑣1 𝑢1 𝑣1 + 𝑢1 𝑉 = 𝑣2 . This is the same as point-vector addition Q-P = 𝑉 → 𝑃 + 𝑉=Q • Point-point addition is not defined 𝑃 𝑉 𝑄 .

Vector Space • Vector Space is a set of vector on which two operations are defined: • Vector Addition • Scalar Multiplication • Vector space lack position specification • We can not precisely define 3D geometry in vector space .

Affine Space • Space elements: • Vector space • Points • There is no special point Parallelism and ratio of lengths • Defined operations: • Vector-Vector addition • Scalar-vector multiplication • Point-vector addition (equivalent to point-point subtraction) • Scalar-scalar operations We defined all the 2D transformation in the affine space .

S. R.…) can be defined using different values of a • Generalization (Affine Sum) 𝛼1 𝛼2 𝑉 =𝑝−𝑞 → 𝑃 𝛼 = 𝑞 + 𝛼 𝑝 − 𝑞 = (1 − 𝛼)𝑞 + 𝛼𝑝 and 𝛼1 + 𝛼2 = 1 𝑃 𝛼 = 𝑛 𝑖=1 𝛼𝑖 𝑝𝑖 .Parametric Line (Affine space) • Set of all points (𝑃) passing through 𝑄 𝑟 in the direction of vector 𝑉 𝑞 𝑃 𝛼 = 𝑞 + 𝛼𝑉 −∞ ≤ 𝛼 ≤ ∞ 𝑉 𝑝 𝑠 • All the points on the line (P. & 𝑛 𝑖=1 𝛼𝑖 =1 −∞ ≤ 𝜶 ≤ ∞ .

& 𝑛 𝑖=1 𝛼𝑖 =1 𝟎 ≤ 𝜶i 𝑝5 .Convexity • An object is convex iff for any two points in the object all points on the line segments between these points are also in the object Convex Not Convex Convex Hull 𝑝2 𝑝1 • Convex hall of a set X of points is the 𝑝3 𝑝4 smallest convex set that contains X 𝑝6 𝑃 𝛼 = 𝑛 𝑖=1 𝛼𝑖 𝑝𝑖 .

Affine Space • The universe of parallel lines • No angle (there is no dot product) • No measurement of length (there is no dot product) • No Special point (origin) • Look at affine space as a vector space with no commitment to any origin point 𝑃 𝛼 = 𝑛 𝑖=1 𝛼𝑖 𝑝𝑖 . & 𝑛 𝑖=1 𝛼𝑖 =1 .

𝑈 = 𝑢2 • Angle 𝑣3 𝑢3 • Orthogonal projection → 𝑉. 𝑈 = 𝑖 𝑣𝑖 𝑢𝑖 = 𝑉 𝑈 𝑐𝑜𝑠𝜃 > 0 • Length of a vector (distance between two points) 𝑝 − 𝑞 = 𝑉 𝑎𝑛𝑑 𝑉 = 𝑉. 𝑉 𝑉 𝑈 . 𝑉 • Angle between two vectors (or lines) 𝜃 = cos−1 𝑈.Euclidian Space • Affine Space + inner product 𝑉 𝜃 • Using inner product we can find: 𝑈 𝑣1 𝑢1 • Distance 𝑉 = 𝑣2 .

𝑽 𝑽𝒖 = 𝑼 𝑼 𝑼 Cross Product 𝑈 × 𝑉 = 𝑊.𝑉 𝑉 𝑈 𝑈 𝑼.𝑉 𝑈 𝑉 𝑈 𝑈 and cos 𝜃 = = 𝑈.Orthogonal Projection • Direction of 𝑽𝒖 : Same as 𝑈 → 𝑈 𝑈 𝑉 𝜃 𝑉𝑢 • Amplitude of 𝑽𝒖 : 𝑉𝑢 = 𝑉 cos 𝜃 • 𝑉𝑢 = 𝑉 cos 𝜃 • 𝑉𝑢 = 𝑉 𝑈 𝑈 𝑈.𝑉 𝑈 𝑈 𝑈 𝑈. 𝑊 = 𝑉 𝑈 sin 𝜃 = 2𝑆 𝑖 𝑊 = 𝑢1 𝑣1 𝑗 𝑢2 𝑣2 𝑘 𝑢3 𝑣3 𝑉 𝜃 𝑆 𝑈 .

𝑐𝑛 . 𝑉𝑛 . . . 𝑐𝑖 = 0 𝑖=1 • This means that one vector can not be represented in terms of other vectors . . . .Linear Combination • if we have several vectors 𝑉1 . . we can form the linear combination 𝑛 𝑐𝑖 𝑉𝑖 𝑖=1 • Set of vectors 𝑉1 . 𝑐2 . 𝑉2 . . . . . . 𝑉2 . and scalars 𝑐1 . . 𝑉𝑛 are linear independent iff 𝑛 𝑐𝑖 𝑉𝑖 = 0 .

Dimension of Vector Space • Minimum number of linearly independent vectors needed to span the space • Spanning the space: representing any possible vectors in the space • Any set of linearly independent vectors form a basis • For a given basis. any vector in that space can be uniquely represented by linear combination of basis .

𝑣2 .Frame • Basis (𝑣1 . 𝑣𝑛 ) + origin (𝑃𝑜 ) • Every vector can be written as 𝑛 𝑉= 𝑐𝑖 𝑣𝑖 𝑖=1 • Every point can be written as 𝑛 𝑃 = 𝑃𝑜 + 𝑎𝑖 𝑣𝑖 𝑖=1 . . . . .

𝑦. 𝑧] • Easy to distinguish points and vecotrs 𝑤≠0 . wy. 𝑧. w → 𝑥.Homogenous Coordinates • n+1 dimension to represent n dimensional space 𝑹𝒏 • Examples in 𝑹𝟑 (Can be generalized to 𝑹𝟒 ) • Points • Vectors wx. wz. 𝑦. 𝑧 . 0 ↔ [𝑥. 𝑥. 𝑦.

Using Frames in HC (2D Example) • Points 𝑃 = 𝛼1 𝛼2 𝑣1 1 𝑣2 𝑃𝑜 • Vectors 𝑉 = 𝑐1 𝑐2 𝑣1 0 𝑣2 𝑃𝑜 .

Points and Vector Relationship • Vector + Vector = Vector • Point + Vector = Point • Point – Point = Vector 𝑉 + 𝑈 = 𝑈+𝑉 0 0 0 𝑃 + 𝑉 = 𝑃+𝑉 1 0 1 𝑞 𝑃 − = 𝑞𝑝 1 1 0 .