## Exploring Analyic Geometry with |
|||||

Home | Contents | Commands | Packages | Explorations | Reference |

Tour | Lines | Circles | Conics | Analysis | Tangents |

Descarta2D Tour

Points

Equations

Lines

Line Segments

Circles

Arcs

Triangles

Parabolas

Ellipses

Hyperbolas

Transformations

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.

Initialize

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.

<<Descarta2D`

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):

Sketch2D[{Point2D[{1,2}],Point2D[{3,-4}],

Point2D[{-2,3}]}]

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

p1=Point2D[{1,2}];

p2=Point2D[{3,-4}];

p3=Point2D[{-2,3}];

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.

{p1,p2,p3}

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

p3=Point2D[p1=Point2D[{-3,-2}],p2=Point2D[{2,1}]]

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:

Clear[x,y];

2*x+3*y-4==0

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

Ax+By+C.

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.

Clear[x,y];

l1=Line2D[2,3,-4];

poly1=2*x+3*y-4;

Polynomial2D[l1,{x,y}]

Line2D[poly1,{x,y}]

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

Quadratic2D[A,B,C,D,E,F]

and functions for converting between polynomials and Quadratic2D objects.

Clear[x,y];

poly1=2*x^2+3*x*y+3*y^2-4*x-5*y-3;

q1=Quadratic2D[2,3,3,-4,-5,-3];

Polynomial2D[q1,{x,y}]

Quadratic2D[poly1,{x,y}]

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, 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.

Clear[x];

Solve[x^2-7*x+10==0,x]

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

Ax+By+C=0

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.

l1=Line2D[p1=Point2D[{-3,-1}],p2=Point2D[{3,2}]]

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.

Sketch2D[{p1,p2,l1}]

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;

{a1,a2}

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.

p1=Point2D[{2,1}];

l1=Line2D[3,1,-2];

{l2=Line2D[p1,l1,Parallel2D],

l3=Line2D[p1,l1,Perpendicular2D]}

Sketch2D[{p1,l1,l2,l3}]

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

Segment2D[{,},{,}]

where and are the coordinates of the start and end points, respectively, of the line segment.

Sketch2D[{l1=Segment2D[{-2,1},{3,-2}]}];

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.

p1=Point2D[l1]

Sketch2D[{l1,p1}]

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].

c1=Circle2D[{1,2},2];

Sketch2D[{c1,Point2D[c1]}]

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.

Radius2D[c1]

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

p1=Point2D[{1,2}];

p2=Point2D[{-1,2}];

p3=Point2D[{0,-2}];

c1=Circle2D[p1,p2,p3]

Sketch2D[{p1,p2,p3,c1}]

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,{,}] (this is not the standard representation of an arc, it is merely one of the ways Descarta2D provides for constructing an arc).

A1=Arc2D[Point2D[{2,1}],3,{Pi/6,5Pi/6}];

Sketch2D[{A1,Point2D[{2,1}]}]

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

p1=Point2D[{2,-1}];

p2=Point2D[{1,2}];

p3=Point2D[{-2,1}];

a1=Arc2D[p1,p2,p3]

Sketch2D[{p1,p2,p3,a1}]

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

Triangle2D[{,},{,},{,}].

t1=Triangle2D[{1,4},{8,8},{6,1}];

Sketch2D[{t1}]

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.

{c1=Circle2D[t1,Inscribed2D],

c2=Circle2D[t1,Circumscribed2D],

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

Sketch2D[{t1,c1,c2,p1}]

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 , 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.

p1=Parabola2D[{1,0},1/2,0];

p2=Parabola2D[{-1,0},1/2,Pi/2];

Sketch2D[{p1,p2}]

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.

e1=Ellipse2D[{0,0},2,1,0];

e2=Ellipse2D[{2,1},3,2,Pi/4];

Sketch2D[{e1,e2}]

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

pts=Foci2D[e2]

Sketch2D[{e2,pts}]

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.

h1=Hyperbola2D[{0,0},2,1,0];

lns=Asymptotes2D[h1];

h2=Hyperbola2D[h1,Conjugate2D];

Sketch2D[{lns}];

{Sketch2D[{lns,h1}],Sketch2D[{lns,h2}]}

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.

e1=Ellipse2D[{0,0},2,1,0];

Sketch2D[{e1,

Translate2D[e1,{3,0}],

Rotate2D[e1,Pi/2],

Scale2D[e1,2],

Reflect2D[e1,Line2D[0,1,-1]]}]

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.

c1=Circle2D[{0,0},2];

{Area2D[c1],Circumference2D[c1]}

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.

l1=Line2D[0,1,-1];

c1=Circle2D[{0,0},2];

t1=TangentCircles2D[{l1,c1},3/8];

Sketch2D[{l1,c1,t1}]

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

c1=Circle2D[{2,0},1];

c2=Circle2D[{-3,0},2];

t1=TangentLines2D[c1,c2];

Sketch2D[{c1,c2,t1}]

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.

l1=Line2D[1,0,-1];

l2=Line2D[0,1,-1];

l3=Line2D[{10,0},{0,6}];

p1=Point2D[{2,3}];

p2=Point2D[{4,2}];

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

Sketch2D[{l1,l2,l3,p1,p2,t1},

PlotRange->{{0,10},{0,6}},

CurveLength2D->20]

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.

Clear[a,b,d];

P1=Point2D[{0,0}];

P2=Point2D[{d,0}];

P3=Point2D[{a,b}];

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].

L12=Line2D[P1,P2,Perpendicular2D];

L13=Line2D[P1,P3,Perpendicular2D];

L23=Line2D[P2,P3,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.

www.Descarta2D.com