Exploring Analyic Geometry with Mathematica®

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

Coordinates and Points

Rectangular Coordinates
Line Segments and Distance
Midpoint between Two Points
Point of Division of Two Points
Collinear Points

The fundamental concept of analytic geometry is the one-to-one correspondence established between points in a plane and (x,y) coordinates. This chapter introduces these concepts and develops some simple functions involving points.


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.


Numbers [Top]

Integers are the whole numbers used for counting, both negative and positive, as well as zero. Ratios of integers such as 1/2, 5/7, 4/1 and 23/15 are called rational numbers. Numbers that can be plotted as distances from a fixed point on a line are called real numbers. Examples are -8, 0, 2.1387, "pts_1.gif", 5/3 and π.

If a and b represent real numbers and "pts_2.gif", the expression a+bi is a complex number. A complex number is the sum of a real number a and a pure imaginary number bi. The two complex numbers a+bi and a-bi are called conjugate complex numbers.

In general, this book deals with real numbers, but since we are using algebraic techniques to study geometry, complex numbers naturally arise in the formulations. Mathematica provides a variety of ways to represent numbers as summarized in Table [pts:tbl01].


Numbers in Mathematica.

Any given number, integer, rational, real or complex, is a constant. Mathematica provides symbols for some common numbers that are fixed value constants as shown in Table [pts:tbl02]. Sometimes we do not wish to specify what the particular constant is and indicate a general constant by any one of the letters a, b, c, , A, B, C, , and such constants are referred to as parameters.


Some common constants in Mathematica.

Rectangular Coordinates [Top]

The basic idea in analytic geometry is to establish a one-to-one correspondence between the points of a plane and number pairs (x,y). This correspondence may be established in many ways, but the one most commonly used is as follows. Consider two perpendicular lines X'X and Y'Y intersecting in the point O. The horizontal line X'X is called the x-axis, and the vertical line Y'Y the y-axis, and together they form a rectangular coordinate system.


Coordinate axes and quadrants.

These axes divide the plane into four quadrants labeled I, II, III and IV as shown in Figure [pts:fig01]. The point O is called the origin. When numerical scales are established on the axes, positive distances x are laid off to the right of the origin and are called abscissas; negative abscissas are laid off to the left. Positive distances y are drawn upwards and are called ordinates; negative ordinates are drawn downward. Thus OX and OY have positive sense (or direction) while OX' and OY' have negative sense. The unit scales on the x-axis and the y-axis need not be the same, but problems in analytic geometry often assume the units are equal on both axes.


Coordinates specifying positions in the plane.

Clearly such a system of coordinates can be used to describe the positions of points in the plane. For example, by going out +3 units on the x-axis and +2 units on the y-axis a point labeled A is located as shown in Figure [pts:fig2]. The point A is said to have the pair of numbers 3 and 2 as its coordinates, and it is customary to write A(3,2) or simply (3,2). Similarly, B has the coordinates (-2,-1) and lies in the third quadrant. It is evident that for the point "pts_7.gif" pictured in the second quadrant, the x-coordinate is negative and the y-coordinate is positive. We will write "pts_8.gif" as the general representation of a point "pts_9.gif" in the plane at coordinates "pts_10.gif" and "pts_11.gif".

The fundamental principle of analytic geometric is that there exists a one-to-one correspondence between number pairs and points in the plane: to each pair of numbers there corresponds one and only one point and, conversely, to each point in the plane there corresponds one and only one pair of numbers.

Example: Plot the points with the following coordinates: (-2,3), (4,2) and (-4,-1).

Solution: Descarta2D represents a point (x,y) as Point2D[{x,y}]. The function Sketch2D[objList] plots a list of objects.



The curly brackets surrounding the point's coordinates are optional and may be omitted. Descarta2D will automatically add the curly brackets when the point's abscissa and ordinate are given as two arguments, Point2D[x,y], as shown below. A symbolic name may be assigned to a point, and this name can be used later to refer to the point.





Line Segments and Distance [Top]

Given two points A and B on the x-axis, or on a line parallel to the x-axis, the line segment "pts_15.gif" from point A to point B extends over a certain number of units of length used as the scale on the x-axis. If the direction from A to B points to the right, we say that "pts_16.gif" is a positive segment. On the other hand, if the direction from A to B points to the left, we say that "pts_17.gif" is a negative segment. Then we can assign to the segment "pts_18.gif" a positive or negative number indicating the direction and number of units of the segment. This signed number is indicated by AB. The absolute value of "pts_19.gif", indicated by "pts_20.gif", is a positive number called the length of the line segment. When the context is clear the symbol AB may be used to represent the line containing the points A and B, the line segment "pts_21.gif", or the length of the segment, "pts_22.gif".

To calculate the number (positive or negative) of x-units in the segment AB, let "pts_23.gif" be the abscissa of B and let "pts_24.gif" be the abscissa of A. Then, if B is to the right of A, the number of x-units in the segment AB is equal to "pts_25.gif". We define BA to be the negative of segment AB. Thus


In the same fashion we can define a directed segment CD on, or parallel to, the y-axis, to be positive or negative depending on whether the arrow from C to D points up (positive direction) or down (negative direction). Thus


Let "pts_28.gif" and "pts_29.gif" be two points lying in the first quadrant and draw line segments "pts_30.gif" and "pts_31.gif" parallel to the coordinate axes as shown in Figure [pts:fig02]. By subtracting the abscissas, "pts_32.gif"; similarly subtracting ordinates, "pts_33.gif". Making use of the Pythagorean Theorem on the right triangle "pts_34.gif", we have


and the positive distance "pts_36.gif", d, is given by



Distance between points.

The same formula holds true regardless of the quadrants in which the points lie and regardless of the order in which the points are taken.

Example: Find the distance between the two points (3,-1) and (-4,-2).

Solution: Taking the points in the given order, we have


Or, taking the points in the opposite order,


The Descarta2D function Distance2D[coord,coord] computes the distance between two locations given as coordinates. The function Distance2D[point,point] computes the distance between two points.



The coordinates of the points may be symbolic and the points themselves may be named points.



Mathematica Hint: The Mathematica function Clear is used in the previous example and throughout other examples in this book to insure that variable names used in the examples are not set to some unintended value from a previous computation.

Descarta2D Hint: There are several Descarta2D functions that are handy for working with points and coordinates. Coordinates2D[point] returns the (x,y) coordinates of a point as the list {x,y}. The functions XCoordinate2D[point] and XCoordinate2D[coord] give the x-coordinate, and YCoordinate2D[point] and YCoordinate2D[coord] give the y-coordinate.

Midpoint between Two Points [Top]


Midpoint between two points.

The midpoint between two points is the point bisecting the line segment connecting the two points. If the coordinates of the two points are "pts_44.gif" and "pts_45.gif" as shown in Figure [pts:fig5], then the midpoint, "pts_46.gif", has coordinates


Example: Find the midpoint between the points (-2,1) and (3,-2).

Solution: The function Point2D[point,point] returns the midpoint of the two points. Alternatively, the function Point2D[lnseg] returns the midpoint of a line segment.



Point of Division of Two Points [Top]


Point of division.

Given a directed line segment such as "pts_50.gif", we wish to find the coordinates of the point P which divides "pts_51.gif" into a given ratio "pts_52.gif" as illustrated in Figure [pts:fig6]. Let P have the coordinates (x,y) which are to be determined. Sense is important here and P must be located so that "pts_53.gif".

Since "pts_54.gif" and "pts_55.gif" are similar, it follows that "pts_56.gif". Solving this equation for x yields




To find the midpoint of the segment "pts_59.gif" the ratio "pts_60.gif" must be unity; hence "pts_61.gif" and Equations ([pts:eq1]) and ([pts:eq2]) specialize to


Equations ([pts:eq1]), ([pts:eq2]) and ([pts:eq3]) also have useful physical interpretations. In ([pts:eq1]) and ([pts:eq2]), let x and y be the coordinates of the center of gravity of masses "pts_63.gif" and "pts_64.gif" placed at "pts_65.gif" and "pts_66.gif", respectively. If the masses are equal, the center of gravity lies halfway between them as indicated by ([pts:eq3]).

It is of further interest to note the positions of P for various values of the ratio "pts_67.gif". If this ratio is zero, then P coincides with "pts_68.gif", and if this ratio is a positive number, P is an internal point of division. As "pts_69.gif", "pts_70.gif". For "pts_71.gif", P is an external point of division (in the direction of "pts_72.gif"). For "pts_73.gif", P is an external point in the opposite direction with "pts_74.gif" negative and "pts_75.gif" positive.

Example: Find the point that divides the line segment between the points "pts_76.gif" and "pts_77.gif" into the ratio "pts_78.gif".

Solution: The Descarta2D function Point2D[point,point,"pts_79.gif","pts_80.gif"] returns the point that divides the line segment between the points into the ratio "pts_81.gif".



Notice that it is invalid for "pts_83.gif" to equal zero in Equations ([pts:eq1]) and ([pts:eq2]) as this would tend to generate a point at infinity.

Point Offset a Distance


Point offset a distance towards a point.

Given two points "pts_85.gif" and "pts_86.gif" we wish to find the point offset a distance, d, from "pts_87.gif" in the direction of "pts_88.gif". We can use the point of division formula from the previous section to determine the coordinates of the offset point. As shown in Figure [pts:fig9] the desired point is a point of division between "pts_89.gif" and "pts_90.gif" where "pts_91.gif" and "pts_92.gif" is the distance between "pts_93.gif" and "pts_94.gif". Using the point of division function from Descarta2D yields



Rearranging and using standard mathematical notation produces


where d is the (possibly negative) offset distance and "pts_97.gif" is the distance between the two points.

Example: Find the point offset a distance 2 from the point (3,1) towards the point (-2,4).

Solution: The Descarta2D function Point2D[point,point,d] returns the point offset a distance d from the first point to the second point.



Collinear Points [Top]

Three distinct points "pts_99.gif", "pts_100.gif" and "pts_101.gif" are said to be collinear if they lie on the same straight line. We can construct any point, "pts_102.gif", on the line "pts_103.gif" by selecting an appropriate value for d and applying Equation ([pts:eq04]). All such points "pts_104.gif", "pts_105.gif" and "pts_106.gif" are obviously collinear by construction. Now consider the value of the determinant


Mathematica provides the Det command for expanding the value of such a determinant.

Det[{{x1,y1,1},{x2,y2,1},{x3,y3,1}}] /.
{x3->x1+(x2-x1)*d/D12,y3->y1+(y2-y1)*d/D12} //Simplify


We see from Mathematica that for any value of d, the determinant given is zero. Therefore, the necessary and sufficient condition that three points lie on the same line is given by the determinant equation


where the coordinates of the points are "pts_110.gif", "pts_111.gif" and "pts_112.gif".

Example: Show that the three points (1,2), (7,6) and (4,4) are collinear.

Solution: The Mathematica function Det[elemList] returns the determinant of the nested list of elements.



Descarta2D provides a specific function for determining whether three points are collinear: IsCollinear2D[point,point,point] returns True if the points are collinear; otherwise, it returns False.



Descarta2D Hint: Using IsCollinear2D is preferable to using the Mathematica function Det for determining collinearity because IsCollinear2D accommodates slight round-off errors that may occur in the floating point arithmetic in the computer.



Explorations [Top]

Collinear Points. [ptscol.html]

Show that the three points (3a,0), (0,3b) and (a,2b) are collinear.

Distance using Polar Coordinates. [polardis.html]

The location of a point in the plane may be specified using polar coordinates, (r,θ), where r is the distance from the origin to the point, and θ is the angle the ray to the point from the origin makes with the +x-axis. Show that the distance, d, between two points "pts_116.gif" and "pts_117.gif", given in polar coordinates, is


Non-uniqueness of Polar Coordinates [polarunq.html]

Show that the polar coordinates of a point (r,θ) are not unique as all points of the form

(r,θ+2kπ)   and   (-r,θ+(2k+1)π)

represent the same position in the plane for integer values of k.

Stewart's Theorem. [stewart.html]


Show that for any △ABC as shown in the figure above the relationship between the lengths of the labeled line segments is given by


Collinear Polar Coordinates [polarcol.html]

Show that the points "pts_121.gif", "pts_122.gif" and "pts_123.gif" in polar coordinates are collinear if and only if


Hypotenuse Midpoint Distance. [tridist.html]

Prove that the midpoint of the hypotenuse of a right triangle is equidistant from the vertices.

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