Exploring Analyic Geometry with Mathematica®

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

Descarta2D Tour

Line Segments
Area and Arc Length
Tangent Curves
Symbolic Proofs
Next Steps

The purpose of this chapter is to provide a tour consisting of examples to show a few of the things Descarta2D can do. Concepts introduced informally in this chapter will be studied in detail in subsequent chapters. The tour is not intended to be a complete overview of Descarta2D, but just a sampling of a few of the capabilities provided by Descarta2D.


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.


Points [Top]

The simplest geometric object is a point in the plane. The location of a point is specified by a pair of numbers called the x- and y-coordinates of the point and is written as (x,y). In Mathematica and Descarta2D point coordinates are enclosed in curly braces as {x,y}. In Descarta2D a point with coordinates (x,y) is represented as Point2D[{x,y}]. The following commands are used to plot the points (1,2), (3,-4) and (-2,3):



Mathematica allows us to assign symbolic names to expressions. The commands


assign the names p1, p2 and p3 to the points sketched previously. After a name is assigned, we can refer to the object by using its name.



Descarta2D provides numerous commands for constructing points. These commands have the name Point2D followed by a sequence of arguments, separated by commas and enclosed in square brackets. For example, the command



constructs a point, named p3, that is the midpoint of two other points named p1 and p2.

Equations [Top]

The underlying principle of analytic geometry is to link algebra to the study of geometry. There are two fundamental problems studied in analytic geometry: (1) given the equation of a curve determine its shape, location and other geometric characteristics; and (2) given a description of the plot of a curve (its locus) determine the equation of the curve. Equations are represented in Mathematica and Descarta2D in a manner that is very similar to standard algebra. For example, the linear equation 2x+3y-4=0 is entered using the following command:



Mathematica Hint: Mathematica uses the double equals sign, ==, to represent the equality in an equation; the single equals sign, =, as has already been shown, is used to assign names. Also, notice that Mathematica sorts all output into a standard order that may be different than the order you typed.

The left side of the equation above is called a linear polynomial in two unknowns. The general form of a linear polynomial in two unknowns is given by


Since linear polynomials occur frequently in the study of analytic geometry, Descarta2D provides a special format for linear polynomials which is of the form Line2D[A,B,C] where A is the coefficient of the x term, B the coefficient of the y term and C is the constant term. Descarta2D also provides functions for converting between linear polynomials and Line2D objects.






Frequently we will also be interested in quadratic equations which represent such curves as circles, ellipses, hyperbolas and parabolas. The algebraic form of a quadratic equation is


Descarta2D provides a special form for representing a quadratic polynomial which is


and functions for converting between polynomials and Quadratic2D objects.






Equations are often constructed so that they may be solved for numbers that make the equality true. For example, the quadratic equation in one unknown, "tour_10.gif" is solved when x=2 or x=5. Mathematica provides powerful functions for solving equations. For example, the Solve command can be used to find the solutions to the equation given above.



The Solve command returns solutions in the form of Mathematica rules which are useful in subsequent computations. We will often need to solve equations in order find the solutions to geometric problems.

Lines [Top]

Intuitively, a straight line is a curve we might draw with a straightedge ruler. In mathematics, a line is considered to be infinite in length extending in both directions. We often think of a line as the shortest path connecting two points, and, in fact, this is one of the many methods provided by Descarta2D for constructing a line. Mathematically, a line is represented as a linear equation of the form


where A, B and C are called the coefficients of the line and determine its position and direction. For example, in Descarta2D the line x-2y+4=0 is represented as Line2D[1,-2,4]. The following command constructs a line from two points.



This is the line -3x+6y-3=0. We can plot the points and the line to get graphical verification that the line passes through the two points.



We might be interested in the angle a line makes measured from the horizontal. The angle can be determined using

a1=Angle2D[l1] //N;
a2=a1 / Degree;


which indicates that the line makes an angle of approximately 0.463648 radians, or about 26.5651 degrees, measured from the horizontal.

Descarta2D Hint: All angles in Descarta2D are expressed in radians. A radian is an angular measure equal to 180/π degrees (about 57.2958 degrees). The Mathematica constant Degree has the value π/180. Dividing an angle in radians by Degree converts the angle from radians to degrees.

We may want to construct lines with certain relationships to another line. For example, the following commands construct lines parallel and perpendicular to a given line through a given point.





Line Segments [Top]

Perhaps it is more familiar to us that a line has a definite start point and end point. Such a line is called a line segment and is represented in Descarta2D as


where "tour_21.gif" and "tour_22.gif" are the coordinates of the start and end points, respectively, of the line segment.


We might want to determine the midpoint of a line segment, and we could use the Point2D[point,point] function to do so, but Descarta2D provides a more convenient function for directly constructing the midpoint of a line segment.





Circles [Top]

A circle's position is determined by its center point and its size is specified by its radius. The standard equation of a circle is


where (h,k) are the coordinates of the center point, and r is the radius of the circle. In Descarta2D a circle is represented as Circle2D[{h,k},r].



As demonstrated by the example, the function Point2D[circle] constructs the center point of the circle. The function Radius2D[circle] returns the radius of a circle.



Descarta2D provides many functions for constructing circles. For example, we can construct a circle that passes through three given points.





Arcs [Top]

Just as a line segment is a portion of a line, an arc is a portion of a circle. We can specify the span of the arc in terms of the angles the arc's sector sides make with the horizontal. In Descarta2D an arc can be constructed using Arc2D[point,r,{"tour_30.gif","tour_31.gif"}] (this is not the standard representation of an arc, it is merely one of the ways Descarta2D provides for constructing an arc).



As with a circle, we can construct an arc in many ways. For example, we can construct an arc passing through three points.





Triangles [Top]

Triangles are defined by three line segments connecting three points called the vertices of the triangle. In Descarta2D a triangle is represented as




We can inscribe a circle inside a triangle, as well as circumscribe one about a triangle. We can also compute properties such as its center of gravity.

p1=Point2D[t1,Centroid2D]} //N




Parabolas [Top]

A parabola is the cross-sectional shape required for a reflective mirror to focus light to a single point. The standard equation of a parabola centered at (0,0) and opening to the right is "tour_44.gif", where f is the focal length, the distance from the vertex point to the focus. We can apply a rotation, θ, to the parabola to produce a parabola of the same shape, but opening in a different direction. In Descarta2D the expression Parabola2D[{h,k},f,θ] is used to represent a parabola.



Ellipses [Top]

An ellipse is a shape of the path a planet makes as it orbits the sun. The standard equation for an ellipse is given by


where 2a is the length of the longer major axis, and 2b is the length of the minor axis. Ellipses in other positions and orientations may be obtained by moving the center point or by rotating the ellipse. In Descarta2D the expression Ellipse2D[{h,k},a,b,θ] is used to represent an ellipse.



An ellipse has two focus points that can also be plotted.





Hyperbolas [Top]

A hyperbola in standard position has an equation similar to an ellipse that is given by


As with the ellipse, the constants a and b represent the lengths of certain axes of the hyperbola. The hyperbola plot consists of two separate pieces, called branches, both extending to infinity in opposite directions. The lines bounding the extent of the hyperbola are called asymptotes. A second hyperbola, closely related to the first, is bounded by the same asymptotes and is called the conjugate hyperbola. Hyperbolas can also be rotated in the plane and moved by adjusting their center points. The expression Hyperbola2D[{h,k},a,b,θ] is used to represent a hyperbola in Descarta2D.



Transformations [Top]

We can change the position, size and orientation of an object by applying a transformation to the object. Common transformations include translating, rotating, scaling and reflecting. A Descarta2D object can be transformed to produce a new object.



Area and Arc Length [Top]

Curves possess certain properties of interest such as area and length. These properties are independent of the position and orientation of the curve.



Additionally, it may be of interest to compute the arc length of a portion of a curve or areas bounded by more than one curve. Descarta2D has a variety of functions for performing such computations.

Tangent Curves [Top]

When two curves touch at a single point without crossing, the two curves are said to be tangent to each other. Descarta2D provides a wide variety of functions for computing tangent lines, circles and other tangent curves. This example produces the circles tangent to a line and a circle with a radius of 3/8. There are eight circles that satisfy these criteria.



This example produces the four lines tangent to two given circles.



Conic curves (ellipses, parabolas and hyperbolas) can also be constructed passing through points or tangent to lines. The following example constructs four ellipses that are tangent to three lines and pass through two points.

t1=TangentConics2D[{l1,l2,l3,p1,p2}] //N;



Symbolic Proofs [Top]

As a final exercise on our tour of Descarta2D we will use the symbolic capabilities of Mathematica to prove a theorem about the perpendicular bisectors of the sides of a triangle. The symbolic capabilities of Mathematica allow us to derive and prove general assertions in analytic geometry. Many of the built-in Descarta2D functions were derived using these capabilities.


Triangle altitudes theorem.

Triangle Altitudes. The three perpendicular bisectors of the sides of a triangle are concurrent in one point. Further, this point is the center of a circle that passes through the three vertices of the triangle.

Without loss of generality, we pick a convenient position for the triangle in the plane as shown in Figure [tour:fig01]. One vertex is located at the origin, the second on the +x-axis and the third is arbitrarily placed.


The perpendicular bisectors of the sides of the triangle pass through the midpoint of each side and are perpendicular to the side. Each of these lines is constructed using the Descarta2D command Line2D[point,point,Perpendicular2D].


By including the semicolon, ;, at the end of each statement, we instruct Mathematica to suppress the output from these statements. Since we are treating these lines symbolically, we have no need at this point to examine the output. If you are curious about the form of lines L12, L13 and L23, they can be examined by entering the command {L12,L13,L23}. We now intersect these lines in pairs to determine the points of intersection using the Descarta2D function Point2D[line,line] that constructs the point of intersection of two lines.

{P4=Point2D[L12,L13] //Simplify,
P5=Point2D[L12,L23] //Simplify}


By inspection, the coordinates of these two points are identical, which proves the first part of the theorem. To prove the second part of the theorem we determine the distance from the intersection point to each of the vertex points and show that the distance is the same for all three vertex points.

{d1,d2,d3}=Map[Distance2D[#,P4]&, {P1,P2,P3}];
{d1-d2, d2-d3, d1-d3} //FullSimplify


Many of the explorations provided at the end of upcoming chapters were developed using techniques similar to the one outlined above. Using Mathematica and Descarta2D to prove general assertions in analytic geometry illustrates the power of these computer programs.

Next Steps [Top]

This completes our high-level tour of Descarta2D. Many of the concepts introduced informally in this chapter will be studied in detail in subsequent chapters. The explorations provided at the end of each chapter provide additional insight into the subject matter and will give you an opportunity to learn the techniques for solving problems using Mathematica. Although many of the chapters can be studied independently, the concepts introduced in earlier chapters are the underlying tools used in subsequent chapters. Therefore, a sequential reading and study of the book is recommended for best understanding and continuity.

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