3. cad dr.c.k.shene geometric concepts

Upload: dineshnewalkar

Post on 02-Jun-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    1/26

    Unit 2: Geometric Concepts

    Coordinate Systems, Points, Lines and Planes

    Two-Dimensional Objects

    Points

    Thexy-coordinate plane has two coordinate axes, thex- andy-axis. They are perpendicular to each

    other. Non-perpendicular axes can be used; but, the computation cost is higher.

    A point in thexy-plane is represented by two numbers, (x, y), wherexandyare the

    coordinates of thex- and y-axes.

    Lines

    A line in thexy-plane has an equation as follows:

    Ax + By + C= 0

    It consists of three coefficientsA,Band C. Cis referred to as the constant term. IfBis non-zero, the

    line equation can be rewritten as follows:

    y = m x + b

    where m = -A/Band b = -C/B. This is the well-known slope-intercept form in which mand bare the

    slopeand the intercept(i.e., the intersection point of the line and they-axis). IfBis zero, the line

    equation becomesAx + C= 0, which is a line parallel to they-axis and intersects thex-axis at point

    (0,-C/A).

    The line equation has three coefficients; but, there are only two independentones. That is,

    given a line equation, dividing the equation by one of its non-zero coefficients will not

    change the line. For example, the line equation 4x+5y+7=0 is equivalent tox+1.25y+1.75=0

    and 0.8x+y+1.4=0. Dividing an equation by a non-zero constant is usually referred to asnormalization. There is one normalization that is very important to us. It is used to compute

    the distance between the origin to a line.

    Suppose the line equation isAx+By+C=0, the distance between the origin and the line is

    given as follows:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    2/26

    Thus, after normalizing the line equation by dividing it with the square root of the sum of the

    squares ofAandB, the absolute value of the new constant term is the distance between the

    origin and the given line.

    Parallel and Perpendicular Lines

    Given two lines as follows:

    Ax + By + C= 0

    Ex + Fy + G= 0

    they are parallel to each other if their slopes are equal. Since the slopes are -A/Band -E/F(ifBandF

    are both non-zero), two lines are parallel to each other if and only if the following holds

    AF=BE

    Note that we can assume thatBorFare both non-zero. Otherwise, if both are zero, the lines areparallel to they-axis and hence are parallel to each other.

    Two lines are perpendicular if and only if the product of their slopes is -1. With the line

    equations above, two lines are perpendicular to each other if and only if the following holds:

    AE=-BF

    Three-Dimensional Objects

    Points

    The coordinate system in space needs three coordinate axes, thex-,y- andz-axis. Therefore, a point in

    space has three components (x,y,z), wherex,yandzare the coordinates of thex-,y- andz-axis.

    Planes

    A plane in space has an equation as follows:

    Ax + By + Cz + D= 0

    It consists of four coefficientsA,B, CandD, whereDis the constant term. Similar to the line case,

    the distance between the origin and the plane is given as

    The normal vector of a plane is its gradient. The gradient of an equation f(x,y,z)=0 is defined

    as follows:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    3/26

    For a plane, its normal vector is simply .

    Unfortunately, a line in space cannot be represented with a single equation. However, it can

    be considered as the intersection of two planes. To ease our discussion, we shall switch to

    using vectors, although this traditional notation is still very useful.

    Vectors

    Vectors have a very important advantage in geometric computing, because it is "coordinate free." The

    meaning of "coordinate free" will be clear in later discussions. All vectors will be in boldface like aand A.

    A vector is similar to a point. If it is a vector in the plane (resp., space), it has two (resp.,

    three) components. Thus, a vector in a n-dimensional space has ncomponents. For our

    applications, we shall distinguish two types of vectors:positionvectors and directionvectors.

    A position vector gives the position of a point. More precisely, a point is a vector. A direction

    vector gives a direction. Hence, it is not a point. In what follows, position vectors and

    direction vector are written with boldface upper case and lower case, respectively. For

    example, Aand aare position and direction vectors, respectively. In many cases, such

    distinction is unnecessary.

    As you have learned in linear algebra or in calculus, you can add and subtract vectors; but

    you can only multiply or divide a vector with constants.

    The length of a vector is the square root of the sum of squares of all components. A unit-

    lengthvector is a vector whose length is one. A vector can be normalizedby dividing its

    components with its length, converting the given vector to a unit-length one while keeping its

    direction the same. For example, if a=, then the length of a, usually written as |a|, is

    SQRT(50) and the normalized ais .

    Inner Product

    Given two vectors aand b, its inner product, written as a.b, is the sum of the products of

    corresponding components. For example, if a= and b= , then a.b= 1*2 + 2*(-1) +

    3*4 = 12.

    The geometric meaning of the inner product of aand bis the following:

    a.b= |a|.|b|cos(t)

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    4/26

    More precisely, the inner product of aand bis equal to the product of the length of a, the length of b,

    and the cosine of the angle tbetween aand b. This is an important formula, because we know the

    following facts about aand bonce the inner product becomes available:

    1. If a.bis zero, where aand bare non-zero vectors, then cos(t) must be zero and, as a result, t

    must be 90 degree. Therefore, aand bare perpendicular to each other.2. If a.bis equal to the product of lengths of aand b, the cosine of tis 1 and tis 0 degree. As a

    result, aand bare parallel to each other and point to the same direction.

    3. If a.bis equal to the negative product of lengths of aand b, the cosine of tis -1 and aand b

    are parallel to each other but point to opposite directions.

    Lines

    A line is defined by a based point Band a direction vector dwhich gives the direction of the line.

    Therefore, the vector equation of a line is

    B+ td

    where tis a parameter. In many applications, the direction vector is of unit-length.

    Planes

    A plane, in its vector form, is specified by a based point Band its normal vector n. For an arbitrary

    point, or position vector, Xon the plane, the direction vector from the base point Bto X, X-B, must be

    perpendicular to the normal vector n. Therefore, we have (X-B).nmust be zero. From (X-B).n=0, we

    have the equation of a plane specified with a base point and its normal vector:

    X.n- B.n= 0

    Given the vector notation of lines and planes, it is very easy to compute the intersection point

    of a line and a plane. Let the given line be A+td. Let the plane be defined with a base point B

    and its normal vector n. Then, this plane has equation X.n=B.n. If the line intersects the

    plane, there must be a value of tsuch that the corresponding point lies on the plane. That is,

    there must be a tsuch that the point corresponding to this twould satisfy the plane equation.

    Since a point on the line is A+td, plugging A+tdinto the plane equation yields

    (A+td).n- B.n= 0

    Rearranging the terms and solving for tyields

    t= (B-A).n/ d.n

    Therefore, plugging this tinto the line equation yields the intersection point.

    In the above, if d.nis zero, tcannot be solved and consequently no intersection point exists.

    The meaning of d.n= 0 is that dand nare perpendicular to each other. Since nis the normal

    vector of a plane and dis perpendicular to n, dmust be parallel to the plane. If the line is

    parallel to the plane, no intersection point exists.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    5/26

    Cross Product

    There is yet one more important concept about vector: the cross product of two vectors. Given two

    vectors aand b, their cross product, written as a b, is defined as follows:

    where a= < a1, a2, a3>, b= < b1, b2, b3>, and | |is a 2-by-2 determinant. In other words, the

    cross product is

    a b= < a2b3- a3b2, -(a1b3- a3b1), a1b2- a2b1>

    The cross product of aand b, a b, is perpendicular to both aand band points to the direction basedon the right-handed system in the order of a, b, a b. Therefore, b apoints to the opposite direction

    of a b. The length of a bis |a| |b| sin(t), where tis the acute angle between aand b. Hence, if a

    and bare perpendicular to each other, the length of a bis simply |a| |b|.

    Simple Curves and Surfaces

    We have seen the simplest curves (lines) and surfaces (planes) in the previous page. Next tolines and planes, there are conics and quadric surfaces. Although conics and quadric surfaces

    have been around for about 2000 years, they are still the most popular objects in many

    computer aided design and modeling systems. We shall discuss conics, quadric surfaces and

    tori on this page only. Consulting your calculus and/or geometry books should be very

    helpful. Your linear algebra book should also cover some of these topics with a modern

    approach.

    The following figures show to you three different ways of cutting a cone with a plane. The

    conic sections, from left to right, are an ellipse, a hyperbola and a parabola.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    6/26

    Curves

    Circles

    The simplest non-linear curve is unquestionably the circle. A circle with center (a,b) and radius rhas

    an equation as follows:

    (x - a)2+ (x - b)

    2= r

    2

    If the center is the origin, the above equation is simplified to

    x2+y

    2= r

    2

    The above equations are referred to as the implicitform of the circle. The parametric form of a circle

    is

    x= rcos(t)y= rsin(t)

    The following is the parametric form of a circle whose center is not the origin:

    x= a+ rcos(t)

    y= b+ rsin(t)

    The above parametric form uses trigonometric functions. We shall discuss a parametric form of a

    circle without trigonometric functions later.

    Conics in Normal Forms

    A direct generalization of the circle is the so-called conic curvesor simply conics. Greeks knew about

    conics very well. In fact, Apollonius of Perga (262 - 200 B.C.) wrote a book of several volumes about

    conics. Conics are the intersection curves of a plane and a circular cone (i.e., a cone whose base is a

    circle and whose axis is perpendicular to the base and through the center of the base circle).

    There are three types of non-degenerate conics: ellipses, hyperbolas and parabolas. Ellipses

    and hyperbolas are called centralconics because they have a center of symmetry, while

    parabolas are non-central.

    The normal form of an ellipse is the following implicit equation:

    The axes of this ellipse are thex- andy-axis, aand bare the axis lengths, and the larger one

    of aand bis the major axis while the smaller one is the minor axis. It is not difficult to see

    that an ellipse in this form has the following parametric form:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    7/26

    x= acos(t)

    y= bsin(t)

    The normal form of a hyperbola is the following implicit equation:

    The definition of major axis and minor axis are identical to that of ellipses. The x-axis

    intersects the curve at two points (a, 0) and (-a, 0) and, they-axis does not intersect the curve

    at all. A possible parametric form of the above hyperbola is the following:

    x= asec(t)

    y= btan(t)

    The center of an ellipse and hyperbola, in normal form, is the coordinate origin and the curve

    is symmetric about its center and its axes.

    The normal form of a parabola is the following implicit equation:

    In this normal form, for any point (x,y) on a parabola, the value ofymust be positive and the

    opening of this parabola is upward. The axis of this parabola is they-axis. It is intersecting to

    note that the normal form of a parabola is already a parametric form. Or, if you like, you can

    rewrite it into the following:

    x= t

    y= t2/ (4p)

    Conics in General Form

    Conics are degree two curves because their most general form is the following degree two implicit

    polynomial:

    In the above polynomial, the coefficients ofxy,xandyare 2B, 2Dand 2E, respectively. This

    polynomial has six coefficients; however, dividing it with a non-zero coefficient would

    reduce six to five. Thus, in general, five conditions can uniquely determine a conic. In linear

    algebra, you perhaps have learned the way of reducing the above polynomial to a normalform using eigenvalues and eigenvectors.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    8/26

    Frequently, we only want to know the curve type of a general second degree polynomial. In

    this case, as long as the second degree equation represents a conic rather than two intersecting

    or parallel lines, it can easily be done as follows:

    1. IfB2A*C, the general equation represents a hyperbola.

    ExpressionB2-A*Cis called the discriminantof the general second degree polynomial. Based on the

    above, if the value of the discriminant is less than, equal to or greater than zero, the conic is an ellipse,

    a parabola, or a hyperbola.

    Conics in Matrix Form

    One nice thing of conics is that its general form can be rewritten compactly using matrices. First, each

    pointx= (x, y) is considered as a column vector whose third component is 1 and hence the transpose

    is a row vector, written as xT= [ x, y, 1 ]. Next, the six coefficients of the general second degree

    polynomial are used to construct a three-by-three symmetric matrix as follows:

    It is not difficult to verify that the general second degree polynomial becomes

    Now what you have learned from linear algebra can be applied to this matrix form.

    Surfaces

    Quadric Surfaces in Normal Forms

    Quadric surfaces, or quadricsfor short, consist of the following different types: ellipsoids,

    hyperboloids of one sheet, hyperboloids of two sheets, elliptic paraboloids, and hyperboloid

    paraboloids. The following are their normal forms in implicit forms and their shapes:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    9/26

    Ellipsoid

    Hyperboloid of One Sheet

    Hyperboloid of Two Sheets

    Elliptic Paraboloid

    Hyperbolic Paraboloid

    These five quadric surfaces are normally referred to as rank four quadrics. There are two

    types of rank three quadrics: cones and cylinders. Cylinders have three subtypes: ellipticcylinders, hyperbolic cylinders and parabolic cylinders as shown below:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    10/26

    Cone

    Elliptic Cylinder

    Hyperbolic Cylinder

    Parabolic Cylinder

    Quadric Surfaces in General Form

    The general form of quadric surfaces is the following:

    It has ten coefficients; but, as mentioned in the discussion of conics, dividing the equation

    with one of its non-zero coefficients reduces the number of coefficients to nine. Please also

    note that except for the coefficients forx2

    ,y2

    andz2

    and the constant term, all coefficients hasa multiplier of 2.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    11/26

    You might want to ask a question: is it possible to develop an algorithm for classifying the

    quadrics just like we did for conics? More precisely, if a general second degree polynomial is

    given, could we tell its type (i.e., ellipsoid, hyperboloid of one sheet, elliptic paraboloid, etc)

    by simply looking at their coefficients? The answer is always a "yes"; but the computation

    algorithm is quite complex. So, I would rather skip this algorithm. However, you can alwaysuse eigenvalues and eigenvectors to solve this problem.

    Quadric Surfaces in Matrix Form

    The equation of a general quadric can also be put into matrix form:

    where (x,y,z) is the coordinates of a point. This form translates the general second

    polynomial of a quadric to the following matrix form:

    Note that it is exactly identical to that of a conic. Therefore, matrices help to bring conics and

    quadrics into an identical form.

    After knowing the matrix form of quadrics, we will be able to discuss the meaning of rank

    four and rank three quadrics. Consider the symmetric matrix Qthat contains the coefficients

    of a general second degree polynomial. The rank of a matrix is the number of non-zero

    eigenvalues. Thus, rank four quadrics are those quadrics whose matrix Qare of rank four. It

    is easy to see (from their normal forms) that ellipsoids, hyperboloids and paraboloids are rank

    four quadrics, and cones and cylinders are rank three quadrics. If a general second degree

    polynomial factors into the product of two distinct degree one polynomials (i.e., planes), Qwill have rank two.

    Tori in Normal Form

    A torus can be generated by rotating a circle, the minorcircle, about a line, the rotation axisor axis of

    rotation. The moving circle has its center on another circle, the majorcircle. The radii of the major

    and minor circles are referred to as the major radius and minor radius, denoted byRand r,

    respectively.

    If the rotation axis is thez-axis and the major circle lies on thexy-plane, the equation of thegenerated torus is the following:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    12/26

    IfRis greater than r, the result is a commonly seen torus as shown in the middle of the

    following figure.

    IFRis equal to r, then all moving circles are tangent to the rotation axis at the coordinate

    origin as shown in the right figure. IfRis less than r, all moving circles intersect the rotation

    axis at two distinct points and the generated torus will have a olive like shape in the interior

    of the torus as shown in the left figure.

    Homogeneous Coordinates

    One of the many purposes of using homogeneous coordinates is to capture the concept of

    infinity. In the Euclidean coordinate system, infinity is something that does not exist.

    Mathematicians have discovered that many geometric concepts and computations can be

    greatly simplified if the concept of infinity is used. This will become very clear when we

    move to curves and surfaces design. Without the use of homogeneous coordinates system, itwould be difficult to design certain classes of very useful curves and surfaces in computer

    graphics and computer-aided design.

    Let us consider two real numbers, aand w, and compute the value of a/w. Let us hold the

    value of afixed and vary the value of w. As wgetting smaller, the value of a/wis getting

    larger. If wapproaches zero, a/wapproaches to infinity! Thus, to capture the concept of

    infinity, we use two numbers aand wto represent a value v, v=a/w. If wis not zero, the value

    is exactly a/w. Otherwise, we identify the infinite value with (a,0). Therefore, the concept of

    infinity can be represented with a number pair like (a, w) or as a quotient a/w.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    13/26

    Let us apply this to thexy-coordinate plane. If we replacexandywithx/wandy/w, a function

    f(x,y)=0 becomesf(x/w,y/w)=0. If functionf(x,y) = 0 is a polynomial, multiplying it with wn

    will clear all denominators, where nis the degree of the polynomial.

    For example, suppose we have a lineAx + By + C= 0. Replacingxandywithx/wandy/w

    yieldsA(x/w) + B(y/w) + C= 0. Multiplying by wchanges it to

    Ax + By + Cw = 0.

    Let the given equation be a second degree polynomialAx2+ 2Bxy + Cy2+ 2Dx + 2Ey + F=

    0. After replacingxandywithx/wandy/wand multiplying the result with w2, we have

    Ax2+ 2Bxy + Cy2+ 2Dxw + 2Eyw + Fw2= 0

    If you look at these two polynomials carefully, you will see that the degrees of all terms are

    equal. In the case of a line, termsx,yand ware of degree one, while in the second degreepolynomial, all terms (i.e.,x2,xy,y2,xw,ywand w2) are of degree two.

    Given a polynomial of degree n, after introducing w, all terms are of degree n. Consequently,

    these polynomials are called homogeneouspolynomials and the coordinates (x,y,w) the

    homogeneous coordinates.

    Given a degree npolynomial in a homogeneous coordinate system, dividing the polynomial

    with wnand replacingx/w,y/wwithxandy, respectively, will convert the polynomial back to

    a conventional one. For example, if the given degree 3 homogeneous polynomial is the

    following:

    x3+ 3xy2- 5y2w+ 10w3= 0

    the result is

    x3+ 3xy2- 5y2+ 10 = 0

    This works for three-dimension as well. One can replace a point (x,y,z) with (x/w,y/w,z/w)

    and multiply the result by wraised to certain power. The resulting polynomial is a

    homogeneous one. Converting a degree nhomogeneous polynomial inx,y,zand wback to

    the conventional form is exactly identical to the two-variable case.

    An Important Notes

    Given a point (x,y,w) in homogeneous coordinates, what is its corresponding point in thexy-

    plane? From what we discussed for converting a homogeneous polynomial back to its

    conventional form, you might easily guess that the answer must be (x/w,y/w). This is correct.

    Thus, a point (3,4,5) in homogeneous coordinates converts to point (3/5,4/5)=(0.6,0.8) in the

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    14/26

    xy-plane. Similarly, a point (x,y,z,w) in homogeneous coordinates converts to a point

    (x/w,y/w,z/w) in space.

    Conversely, what is the homogeneous coordinates of a point (x,y) in thexy-plane? It is simply

    (x,y,1)! That is, let the wcomponent be 1. In fact, this is only part of the story, because the

    answer is notunique. The homogeneous coordinates of a point (x,y) in thexy-plane is (xw,

    yw, w) for any non-zero w. Why is this true? Because (xw,yw, w) is converted back to (x,y).

    As a result, the following is important for you to memorize:

    Converting from a homogeneous coordinates to a conventional one is unique; but,

    converting a conventional coordinates to a homogeneous one is not.

    For example, a point (4,2,3) in space is convert to (4w, 2w, 3w, w) for any non-zero w.

    The Dimensionality of Homogeneous Coordinates

    You perhaps have discovered that homogeneous coordinates need 3 and 4 components to

    represent a point in thexy-plane and a point in space, respectively. Therefore, a point in space

    (resp., thexy-plane) in homogeneous coordinates actually has four(resp., third) components.

    Adding a fourth (resp., third) component whose value is 1 to the coordinates of a point in

    space (resp., thexy-plane) converts it to its corresponding homogeneous coordinates.

    Ideal Points or Points at Infinity

    As mentioned at the very beginning of this page, homogeneous coordinates can easily capture

    the concept of infinity. Let a point (x,y) be fixed and converted to a homogeneous coordinate

    by multiplying with 1/w, (x/w,y/w,1/w). Let the value of wapproach to zero, then (x/w,y/w)

    moves farther and farther away in the direction of (x,y). When wbecomes zero, (x/w,y/w)

    moves to infinity. Therefore, we would say, the homogeneous coordinate (x,y,0) is the ideal

    pointorpoint at infinityin the direction of (x,y).

    Let us take a look at an example. Let (3,5) be a point in the xy-plane. Consider (3/w,5/w). If w

    is not zero, this point lies on the liney= (5/3)x. Or, if you like the vector form, (3/w,5/w) is a

    point on the line O+ (1/w)d, where the base point Ois the coordinate origin and dis the

    direction vector . Therefore, as wapproaches zero, the point moves to infinity on the

    line. This is why we say (x,y,0) is the ideal point or the point at infinity in the direction of

    (x,y).

    The story is the same for points in space, where (x,y,z,0) is the ideal point or point at infinity

    in the direction of (x,y,z).

    The concept of homogeneous coordinates and points at infinity in certain direction willbecome very important when we discuss representations of curves and surface.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    15/26

    A Simple Geometric Interpretation

    Given a homogeneous coordinate (x,y,w) of a point in thexy-plane, let us consider (x,y,w) to

    be a point in space whose coordinate values arex,yand wfor thex-,y- and w- axes,

    respectively. The line joining this point and the coordinate origin intersects the plane w= 1 at

    a point (x/w,y/w, 1). Please verify this fact yourself. The following figure illustrates this

    concept.

    This transformation treats a two-dimensional homogeneous point as a point in three-

    dimensional space and projects (from the coordinate origin) this three-dimensional point to

    the plane w=1. Therefore, as a homogeneous point moves on a curve defined byhomogeneous polynomialf(x,y,w)=0, its corresponding point moves in three-dimensional

    space, which, in turn, is projected to the plane w=1. Of course, (x/w,y/w) moves on a curve in

    plane w=1.

    The above figure also shows clearly that while the conversion from the conventional

    Euclidean coordinates to homogeneous coordinates is unique, the opposite direction is not

    because all points on the line joining the origin and (x,y,w) will be projected to (x/w,y/w,1).

    This is also an important concept to be used in later lectures.

    Geometric Transformations

    When talking about geometric transformations, we have to be very careful about the object

    being transformed. We have two alternatives, either the geometric objects are transformed or

    the coordinate system is transformed. These two are very closely related; but, the formulae

    that carry out the job are different. We only cover transforming geometric objects here.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    16/26

    We shall start with the traditionalEuclidean transformationsthat do not change lengths and

    angle measures, followed byaffine transformation.Finally, we shall talk aboutprojective

    transformations.

    Euclidean Transformations

    The Euclidean transformations are the most commonly used transformations. An Euclidean

    transformation is either a translation, a rotation, or a reflection. We shall discuss translations and

    rotations only.

    Translations and Rotations on the xy-Plane

    We intend to translate a point in thexy-plane to a new place by adding a vector . It is not

    difficult to see that between a point (x, y) and its new place (x', y'), we havex'=x+ handy'=y+ k.

    Let us use a form similar to the homogeneous coordinates. That is, a point becomes a column vector

    whose third component is 1. Thus, point (x,y) becomes the following:

    Then, the relationship between (x, y) and (x', y') can be put into a matrix form like the following:

    Therefore, if a line has an equationAx + By + C= 0, after plugging the formulae forxandy,

    the line has a new equationAx' + By' + (-Ah - Bk + C) = 0.

    If a point (x, y) is rotated an angle aabout the coordinate origin to become a new point (x', y'),

    the relationships can be described as follows:

    Thus, rotating a lineAx + By + C= 0 about the origin adegree brings it to a new equation:

    http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#euclideanhttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#euclideanhttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#euclideanhttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#affinehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#affinehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#affinehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#projectivehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#projectivehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#projectivehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#projectivehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#projectivehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#projectivehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#projectivehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#affinehttp://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/geo-tran.html#euclidean
  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    17/26

    (Acosa-Bsina)x'+ (Asina+Bcosa)y'+ C= 0

    Translations and rotations can be combined into a single equation like the following:

    The above means that rotates the point (x,y) an angle aabout the coordinate origin and

    translates the rotated result in the direction of (h,k). However, if translation (h,k) is applied

    first followed by a rotation of angle a(about the coordinate origin), we will have the

    following:

    Therefore, rotation and translation are not commutative!

    In the above discussion, we always present two matrices, Aand B, one for transforming xto

    x'(i.e., x'=Ax) and the other for transforming x'to x(i.e., x=Bx'). You can verify that the

    product of Aand Bis the identity matrix. In other words, Aand Bare inverse matrices of

    each other. Therefore, if we know one of them, the other is the inverse of the given one. For

    example, if you know Athat transforms xto x', the matrix that transforms x'back to xis the

    inverse of A.

    Let Rbe a transformation matrix sending x'to x: x=Rx'. Plugging this equation of xinto a

    conic equation gives the following:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    18/26

    Rearranging terms yields

    This is the new equation of the given conic after the specified transformation. Note that the

    new 3-by-3 symmetric matrix that represents the conic in a new position is the following:

    Now you see the power of matrices in describing the concept of transformation.

    Translations and Rotations in Space

    Translations in space is similar to the plane version:

    The above translates points by adding a vector .

    Rotations in space are more complex, because we can either rotate about the x-axis, they-axis

    or thez-axis. When rotating about thez-axis, only coordinates ofxandywill change and the

    z-coordinate will be the same. In effect, it is exactly a rotation about the origin in thexy-

    plane. Therefore, the rotation equation is

    With this set of equations, letting abe 90 degree rotates (1,0,0) to (0,1,0) and (0,1,0) to (-

    1,0,0). Therefore, thex-axis rotates to they-axis and they-axis rotates to the negative

    direction of the originalx-axis. This is the effect of rotating about thez-axis 90 degree.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    19/26

    Based on the same idea, rotating about thex-axis an angle ais the following:

    Let us verify the above again with abeing 90 degree. This rotates (0,1,0) to (0,0,1) and

    (0,0,1) to (0,-1,0). Thus, they-axis rotates to thez-axis and thez-axis rotates to the negative

    direction of the originaly-axis.

    But, rotating about they-axis is different! It is because the way of measuring angles. In a

    right-handed system, if your right hand holds a coordinate axis with your thumb pointing in

    the positive direction, your other four fingers give the positive direction of angle measuring.

    More precisely, the positive direction for measuring angles is from the z-axis tox-axis.

    However, traditionally the angle measure is from thex-axis to thez-axis. As a result, rotating

    an angle aabout they-axis in the sense of a right-handed system is equivalent to rotating an

    angle -ameasuring from thex-axis to thez-axis. Therefore, the rotation equations are

    Let us verify the above with rotating about they-axis 90 degree. This rotates (1,0,0) to (0,0,-

    1) and (0,0,1) to (1,0,0). Therefore, thex-axis rotates to the negative direction of thez-axis

    and thez-axis rotates to the originalx-axis.

    A rotation matrix and a translation matrix can be combined into a single matrix as follows,

    where the r's in the upper-left 3-by-3 matrix form a rotation andp, qand rform a translation

    vector. This matrix represents rotations followed by a translation.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    20/26

    You can apply this transformation to a plane and a quadric surface just as what we did for

    lines and conics earlier.

    Affine TransformationsEuclidean transformations preserve length and angle measure. Moreover, the shape of a geometric

    object will not change. That is, lines transform to lines, planes transform to planes, circles transform

    to circles, and ellipsoids transform to ellipsoids. Only the position and orientation of the object will

    change. Affine transformations are generalizations of Euclidean transformations. Under affine

    transformations, lines transforms to lines; but, circles become ellipses. Length and angle are not

    preserved. In this section, we shall discuss scaling, shear and general affine transformations.

    Scaling

    Scaling transformations stretch or shrink a given object and, as a result, change lengths and angles.So, scaling is not an Euclidean transformation. The meaning of scaling is making the new scale of a

    coordinate directionptimes larger. In other words, thexcoordinate is "enlarged"ptimes. This

    requirement satisfiesx'=p xand thereforex=x'/p.

    Scaling can be applied to all axes, each with a differentscaling factor. For example, if thex-,

    y- andz-axis are scaled with scaling factorsp, qand r, respectively, the transformation matrix

    is:

    Shear

    The effect of a shear transformation looks like ``pushing'' a geometric object in a direction parallel to

    a coordinate plane (3D) or a coordinate axis (2D). In the following, the red cylinder is the result ofapplying a shear transformation to the yellow cylinder:

    How far a direction is pushed is determined by ashearing factor. On thexy-plane, one can

    push in thex-direction, positive or negative, and keep they-direction unchanged. Or, one can

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    21/26

    push in they-direction and keep thex-direction fixed. The following is a shear transformation

    in thex-direction with shearing factor a:

    The shear transformation in they-direction with shearing factor bis the following:

    In space, one can push in two coordinate axis directions and keep the third one fixed. The

    following is the shear transformation in bothx- andy-directions with shearing factors aand b,

    respectively, keeping thez-coordinate the same:

    Let us take a look at the effect of this shear transformation. Expanding the matrix equation

    gives the following:

    x'=x+ az

    y'=y+ bz

    z'=z

    Thus, a point (x, y, z) in space is transformed to (x+ az,y+ bz,z). Therefore, thez-coordinate does

    not change, while (x, y) is ``pushed'' in the direction of (a, b, 0) with a factorz.

    The following is the shear transformation inxz-direction:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    22/26

    The following is the shear transformation inyz-direction:

    General Affine Transformations

    The general affine transformation matrix has the following form:

    Comparing with all previous discussed matrices, rotations and translations included, you will

    see that all of them fit into this form and hence are affine transformations. Affine

    transformations do not alter the degree of a polynomial, parallel lines/planes are transformed

    to parallel lines/planes, and intersecting lines/plane are transformed to intersecting lines and

    planes. However, affine transformations do not preserve lengths and angle measures and as a

    result they will change the shape of a geometric object. The following shows the result of a

    affine transformation applied to a torus. A torus is described by a degree four polynomial.

    The red surface is still of degree four; but, its shape is changed by an affine transformation.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    23/26

    Note that the matrix form of an affine transformation is a 4-by-4 matrix with the fourth row 0,

    0, 0 and 1. Moreover, if the inverse of an affine transformation exists, this affine

    transformation is referred to as non-singular; otherwise, it issingular. We do not use singular

    affine transformations in this course.

    Projective Transformations

    Projective transformations are the most general "linear" transformations and require the use of

    homogeneous coordinates. Given a point in space in homogeneous coordinate (x,y,z,w) and its image

    under a projective transform (x',y',z',w'), a projective transform has the following form:

    In the above, the 4-by-4 matrices must be non-singular (i.e., invertible). Therefore, projective

    transformations are more general than affine transformations because the fourth row does not

    have to contain 0, 0, 0 and 1.

    Projective transformation can bring finite points to infinity and points at infinity to finite

    range. Let us take a look at an example. Consider the following projective transformation:

    Obviously, this transformation sends (x,y,w)=(1,0,1) to (x',y',w') = (1,-1,0). That is, this

    projective transformation sends (1,0) on thexy-plane to the point at infinity in direction . From the right-hand side of the matrix equation x=Px'we have

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    24/26

    x= 2x' + y'

    y=x' + y'

    w= 2x' + y' + w'

    Let us consider a circlex^2 +y^2 = 1. Plugging the above equations into the circle equation changes it

    to the following:

    x2+ 2xy+y

    2- 4xw- 2yw- w

    2= 0

    Dividing the above by w^2 to convert it back to conventional form yields

    x2+ 2xy+y

    2- 4x- 2y- 1 = 0

    This is a parabola! (Why?) Therefore, a circle that has no point at infinity is transformed to a parabola

    that does have point at infinity.

    While projective transformations, like affine transformations, do not change the degree of a

    polynomial, two parallel (i.e., intersecting) lines/planes can be transformed to two

    intersecting (i.e., parallel) lines/planes. Please verify this fact yourself.

    Although we do not use these facts and the concept of projective transformations

    immediately, it will be very helpful in later lectures.

    Matrix Multiplication and Transformations

    We have introduced to you several transformations. We always show to you two forms, one from xto

    x'and the other the inverse from x'to x. In many cases, one may need several transformations to

    bring an object to its desired position. For example, one may need a transformation in matrix form

    q=Apbringing pto q, followed by a second transformation r=Bqbringing qto r, followed by yet

    another transformation s=Crbringing rto s. The net effect of p-> q-> r-> scan be summarized into

    a single transformation represented by the product of all involved matrices. Note that the first (resp.,

    last) transformation matrix is the right-most (resp., left-most) in the multiplication sequence.

    s= Cr= C(Bq) = CBq= CB(Ap) = CBAp

    Therefore, to compute the net effect, we just compute CBAand use it as a single transformation,

    which brings pto s.

    Let us take a look at an example. We want to perform the following transformations to an

    object:

    1. Scale in thex-direction using a scale factor 5 (i.e., making it five times larger).

    2. Followed by a rotation aboutz-axis 30 degree

    3. Followed by a shear transformation inx- andy-direction with shearing factor 2 and 3,

    respectively.

    4. Followed by a transformation moving the point in the direction of < 2, 1, 2 >.

    Let the scaling, rotation, shearing and translation matrices be A, B, Cand D, respectively. With

    previous discussion, we have the following, where matrix H= DCBAis the net effect:

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    25/26

    Therefore, the net effect of transforming a point xof the initial object to the corresponding

    point x'after the above four transformations is computed as x'= Hx= DCBAx.

    Problems

    1. Given a line B+tdand a plane with base point Aand normal vector n, what is the

    condition for the line is perpendicular to the plane? What is the condition for the line

    to be parallel to the plane?

    References

    Most of this week's material are from Bowyer and Wookwark's little book. The example

    showing the bad effect of the associative law is from Colonna's paper. Finally, you can

    find more about floating pointing computation problems is Acton's book.

    Wolfgang Boehm and Hartmut Prautzsch, Geometr ic Concepts for Geometr icDesign, AK Peters, Wellesley, MA, 1994.

  • 8/10/2019 3. CAD Dr.C.K.shene Geometric Concepts

    26/26

    Michael E. Mortenson, Computer Graphics: An I ntr oduction to the Mathematics

    and Geometry, Heinemann Newnes, Oxford, UK, 1989.