Exploring Analyic Geometry with Mathematica®

Home Contents Commands Packages Explorations Reference
Tour Lines Circles Conics Analysis Tangents



A transformation is a mathematical operation that changes a function of variables, say f(x,y), into a new function f'(x',y') where


These equations are called the equations of the transformation. Transformations can often be constructed so that f' is much simpler than f. In this chapter we will study four transformations that have useful geometric interpretations: translation, rotation, scaling and reflection.


To initialize Descarta2D, select the input cell bracket and press SHIFT-Enter.

This initialization assumes that the Descarta2D software has been copied into one of the standard directories for AddOns which are on the Mathematica search path, $Path.


Translations [Top]

A translation is a transformation that maps coordinates (x,y) into


When a translation is applied to a locus of points, the resulting locus has the same shape and orientation as the original one, but its position with respect to the coordinate axes is offset by distances u in the x-direction and v in the y-direction. The equations of the transformation are

x'=x+u   and   y'=y+v.

Example: Determine the coordinates of the point that results from translating (3,2) by u=-1 and v=-3.

Solution: The function Translate2D[{x,y},{u,v}] translates a coordinate list (x,y) by the specified offset (u,v), returning a new coordinate list. The function Translate2D[point,{u,v}] performs the same translation and returns a translated point.



A translation can also be applied to an equation. For example, if


is a linear equation in two variables, we can translate this by making the substitutions x=x'-u and y=y'-v. Mathematica provides powerful functions for performing these transformations.

a*x+b*y+c /. {x->x-u,y->y-v} //Expand


In standard mathematical notation the translated equation is


Mathematica Hint: The Mathematica function Replace, represented by the /. operator, applies a set of replacement rules to an expression.

In a similar manner a quadratic equation can be translated. Again Mathematica provides a convenient means for performing the algebraic operations.

a*x^2+b*x*y+c*y^2+d*x+e*y+f /.
   {x->x-u,y->y-v} //Expand


Collecting terms and writing in standard mathematical notation yields the translated quadratic equation



A' = A
B' = B
C' = C
D' = D-2Au-Bv
E' = E-2Cv-Bu
F' = "trans_6.gif"

Using these basic formulas for translations it is easy to translate other objects. The location of curves, such as circles, ellipses and conic arcs, are defined by points and can be translated by translating the points themselves. For example, Ellipse2D[{h,k},a,b,θ] is translated to Ellipse2D[{h+u,k+v},a,b,θ].

Example: Translate the ellipse


by the offsets u=2 and v=-2. Plot both the original ellipse and the translated ellipse.

Solution: The function Translate2D[object,{u,v}] translates an object u in the x-direction and v in the y-direction. The object may be a coordinate list, a geometric object or a list of Descarta2D objects.





Rotations [Top]


Rotation transformation.

A rotation by an angle θ about the origin is a transformation that maps coordinates (x,y) into (xcosθ-ysinθ,ycosθ+xsinθ). The mapping is easily confirmed using trigonometry as shown in Figure [trans:fig02].

cosα = x/r
sinα = y/r
x' = OA'
. = rcos(α+θ)
. = r(cosαcosθ-sinαsinθ)
. = r((x/r)cosθ-(y/r)sinθ)
. = xcosθ-ysinθ.

Similarly, it can be shown that y'=ycosθ+xsinθ.

In order to rotate about a point (h,k), we first translate the coordinates to the origin, perform the rotation using the equations above, then apply the inverse translation to restore the object to its original position with the rotation applied. The general equations of a rotation so derived are

x' = h+(x-h)cosθ-(y-k)sinθ
y' = k+(x-h)sinθ+(y-k)cosθ.

In order to rotate a linear equation Ax+By+C=0 we need to solve these equations for x and y so that we can substitute these values into the equation. Solving for x and y in terms of x' and y' (and making use of the identity "trans_11.gif") yields the equations

x = h+(x'-h)cosθ+(y'-k)sinθ
y = k-(x'-h)sinθ+(y'-k)cosθ.

Substituting into Ax+By+C yields the equation



A' = Acosθ-Bsinθ
B' = Bcosθ+Asinθ
C' = Ah+Bk+C-(Ah+Bk)cosθ-(Ak-Bh)sinθ.

Rotating the quadratic equation "trans_12.gif" is accomplished in the same manner, by replacing x and y with the proper rotated coordinates. The resulting expressions for the coefficients of the rotated quadratic equation,


are somewhat long, but can be written symbolically as

A' = "trans_14.gif"
B' = "trans_15.gif"
C' = "trans_16.gif"
D' = "trans_17.gif"
. . 2(Bh-(A-C)k)cosθsinθ+
. . (2Ah+Bk+D)cosθ-(Bh+2Ck+E)sinθ
E' = "trans_18.gif"
. . 2((A-C)h+Bk)cosθsinθ+
. . (Bh+2Ck+E)cosθ+(2Ah+Bk+D)sinθ
F' = "trans_19.gif"
. . "trans_20.gif"
. . "trans_21.gif"
. . "trans_22.gif"
. . "trans_23.gif"
. . "trans_24.gif"

By applying the formulas for rotating coordinates, linear equations and quadratic equations, we can now specify how to rotate all of the Descarta2D objects. Points and lines can be rotated by directly applying the formulas for coordinates and linear equations, respectively. Curves that are located by points can be rotated by rotating the defining points; additionally, curves that have orientation angles, such as arcs, parabolas, ellipses and hyperbolas, are rotated by adding the rotation angle, θ, to the angle of the curve.

Example: Rotate the ellipse


π/2 radians about its center point and about the origin. Plot all three ellipses.

Solution: The Descarta2D function Rotate2D[object,θ,{"trans_26.gif","trans_27.gif"}] rotates an object by angle θ about point "trans_28.gif". The function Rotate2D[object,θ] rotates an object by angle θ about the origin. The object may be a coordinate list, a geometric object or a list of Descarta2D objects.






Scaling [Top]

A scaling transformation maps coordinates (x,y) to (x',y') using the transformation equations

x'=h+s(x-h)   and   y'=k+s(y-k).

The scale factor, s>0, indicates the ratio of corresponding lengths of the scaled object with respect to the original object. The point (h,k) is called the center of scaling. A point at the center of scaling does not change coordinates during a scaling transformation.

Solving the scaling transformation equations for (x,y) in terms of (x',y') yields


Substituting the coordinates (x,y) into the linear polynomial Ax+By+C yields the scaled linear polynomial


Similarly, applying a scaling transformation to the quadratic polynomial





A' = "trans_35.gif"
B' = "trans_36.gif"
C' = "trans_37.gif"
D' = (D+(1-s)(2Ah+Bk))/s
E' = (E+(1-s)(Bh+2Ck))/s
F' = "trans_38.gif"

The scaling transformation may be applied to Descarta2D geometric objects by applying the coordinate scaling transformation to the positioning arguments and simultaneously multiplying the length arguments by the scale factor.

Example: Scale the circle "trans_39.gif" by a factor of 3/2 about its center point and the origin. Plot the three circles.

Solution: The function Scale2D[object,s,{h,k}] scales the object using scale factor s about the center of scaling (h,k). Scale2D[object,s] scales the object about the origin. The object may be a coordinate list, a geometric object or a list of Descarta2D objects.





Reflections [Top]

A reflection transformation maps the coordinates (x,y) to coordinates that are the "mirror" reflection of the coordinates with respect to a line that represents the position of the mirror. Consider the point "trans_42.gif" and the reflection line "trans_43.gif". The following Descarta2D commands can be used to determine the coordinates of the reflection of point "trans_44.gif" in line "trans_45.gif".

           2*Distance2D[p1,l2]] //Simplify


In standard mathematical notation the coordinates "trans_47.gif" of the reflected point are given by the transformation equations

"trans_48.gif" = "trans_49.gif"
"trans_50.gif" = "trans_51.gif"

Solving the transformation equations for "trans_52.gif" in terms of "trans_53.gif" yields

"trans_54.gif" = "trans_55.gif"
"trans_56.gif" = "trans_57.gif"

Mathematica Hint: While it is feasible to solve these equations manually using algebra, it is much less effort to let Mathematica do the work using the Solve function. The command would be of the form

       y2==YCoordinate2D[p2]},{x1,y1}] //Simplify


Substituting the coordinates "trans_59.gif" into a linear equation "trans_60.gif" yields the reflected linear equation



"trans_62.gif" = "trans_63.gif"
"trans_64.gif" = "trans_65.gif"
"trans_66.gif" = "trans_67.gif"

Substituting the coordinates "trans_68.gif" into a quadratic polynomial


yields a quadratic Q' reflected in the line "trans_70.gif" of the form



A' = "trans_72.gif"
B' = "trans_73.gif"
C' = "trans_74.gif"
D' = "trans_75.gif"
E' = "trans_76.gif"
F' = "trans_77.gif"


"trans_78.gif" "trans_79.gif" "trans_80.gif"

"trans_81.gif" . "trans_82.gif"
"trans_83.gif" . "trans_84.gif"

Reflection of an Angle


A reflected angle.

What angle does a reflected line make with the +x-axis? Let L be a line that makes an angle θ with the +x-axis, "trans_86.gif" be a reflection line that makes an angle α with the +x-axis, and L' the reflection of L in "trans_87.gif" as shown in Figure [trans:fig05]. We wish to determine the angle θ' that L' makes with the +x-axis. Using the fact that supplementary angles sum to π and that the interior angles of a triangle sum to π, the angle θ'=2α-θ. The relationship also holds true when α=θ, in which case L and L' do not intersect. By applying the methods for reflecting coordinates, equations and angles we are able to reflects all of the geometric objects in the Descarta2D system.

Example: Reflect the arc centered at (3,2) with radius 1 and start and end angles of π and 3π/2 in the line x+3y+2=0.

Solution: The Descarta2D function Reflect2D[object,line] reflects the object with respect to the line. The object may be a coordinate list, a geometric object, or a list of objects.





Explorations [Top]

Reflection in a Point. [reflctpt.html]

A point P'(x',y') is said to be the reflection of a point P(x,y) in the point C(H,K) if C is the midpoint of the segment PP'. Using this definition show that

• The transformation equations for a reflection in a point are

x'=2H-x    x=2H-x'
y'=2K-y    y=2K-y'.

• The reflection of the line ax+by+c=0 in the point (H,K) is


• The reflection of the quadratic "trans_90.gif" in the point (H,K) is

. "trans_91.gif" .
. "trans_92.gif" .

Also, verify that the reflection in a point transformation is equivalent to a rotation of π radians about the reflection point (H,K).

Inversion. [inverse.html]

A point P'(x',y') is said to be the inverse of a point P(x,y) in the circle


if points O(h,k), P and P' are collinear and "trans_94.gif". Using this definition show that

• The coordinates of P'(x',y') are


• If the circle of inversion is "trans_96.gif", the coordinates of P' are


• If the circle of inversion is "trans_98.gif", the inverse of the line "trans_99.gif", assuming L does not pass through the origin, is the circle


• If the circle of inversion is "trans_101.gif", the inverse of the line "trans_102.gif", assuming L passes through the origin ("trans_103.gif"), is L itself.

• If the circle of inversion is "trans_104.gif", the inverse of the circle "trans_105.gif" is


• If the circle of inversion is "trans_107.gif", the inversion of "trans_108.gif", which passes through the origin, is the line "trans_109.gif". L is parallel to the tangent line to C through the origin. The equation of the tangent line is "trans_110.gif".

Inversion is clearly a non-rigid transformation.

Copyright © 1999-2007 Donald L. Vossler, Descarta2D Publishing