Math Core

Module 4.6 · Geometry

Coordinate geometry

Coordinates turn geometry into arithmetic. Once you place a figure on the coordinate plane, distances, midpoints, slopes and areas all come from short formulas, and many problems that look like pure geometry get easier when you add axes yourself.

Distance, midpoint and slope

For points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2):

  • Distance: (x2−x1)2+(y2−y1)2\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}. This is just the Pythagorean theorem: the horizontal and vertical gaps are the legs of a right triangle.
  • Midpoint: (x1+x22,y1+y22)\left(\dfrac{x_1 + x_2}{2}, \dfrac{y_1 + y_2}{2}\right), the average of the coordinates.
  • Slope: y2−y1x2−x1\dfrac{y_2 - y_1}{x_2 - x_1}, rise over run.

Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1-1, so the slope of a perpendicular is the negative reciprocal (slope 23\dfrac{2}{3} becomes −32-\dfrac{3}{2}).

Areas on the coordinate plane

If a side of a triangle is horizontal or vertical, use 12bh\dfrac{1}{2}bh directly. If not, you have two good options.

Box it in. Draw the smallest rectangle around the triangle with horizontal and vertical sides. Subtract the right triangles in the corners.

Shoelace formula. List the vertices in order around the shape, repeating the first at the end.

The shoelace formula

For a polygon with vertices (x1,y1),(x2,y2),…,(xn,yn)(x_1, y_1), (x_2, y_2), \dots, (x_n, y_n) listed in order around the shape:

Area=12∣(x1y2−x2y1)+(x2y3−x3y2)+⋯+(xny1−x1yn)∣.\text{Area} = \frac{1}{2}\left| (x_1 y_2 - x_2 y_1) + (x_2 y_3 - x_3 y_2) + \dots + (x_n y_1 - x_1 y_n) \right|.

Each term uses two neighboring vertices: "this xx times next yy, minus next xx times this yy."

The vertices must go around the polygon in order (either direction). Jumping across the shape gives a wrong answer.

Lattice points on a segment

A lattice point has whole-number coordinates. The segment from (0,0)(0, 0) to (a,b)(a, b), with aa and bb positive whole numbers, passes through gcd⁡(a,b)+1\gcd(a, b) + 1 lattice points, counting both endpoints. The steps between them are all equal, each (ag,bg)\left(\dfrac{a}{g}, \dfrac{b}{g}\right) where g=gcd⁡(a,b)g = \gcd(a, b). The same count works for any segment between lattice points, using the horizontal and vertical gaps.

Worked example: Distance and midpoint

Find the distance between A(−2,3)A(-2, 3) and B(4,11)B(4, 11), and the midpoint of AB‾\overline{AB}.

The gaps are 66 and 88, so the distance is 36+64=10\sqrt{36 + 64} = 10. The midpoint is (−2+42,3+112)=(1,7)\left(\dfrac{-2 + 4}{2}, \dfrac{3 + 11}{2}\right) = (1, 7).

Worked example: Area of a tilted triangle, two ways

Find the area of the triangle with vertices (1,1)(1, 1), (7,3)(7, 3) and (3,8)(3, 8).

The triangle, boxed in by a 6 by 7 rectangle.Open in grapher →

Box it in. The rectangle from x=1x = 1 to 77 and y=1y = 1 to 88 has area 6⋅7=426 \cdot 7 = 42. The three corner triangles have areas 12⋅6⋅2=6\dfrac{1}{2} \cdot 6 \cdot 2 = 6, 12⋅4⋅5=10\dfrac{1}{2} \cdot 4 \cdot 5 = 10 and 12⋅2⋅7=7\dfrac{1}{2} \cdot 2 \cdot 7 = 7. The triangle's area is 42−23=1942 - 23 = 19.

Shoelace.

12∣(1⋅3−7⋅1)+(7⋅8−3⋅3)+(3⋅1−1⋅8)∣=12∣−4+47−5∣=19.\frac{1}{2}\left| (1 \cdot 3 - 7 \cdot 1) + (7 \cdot 8 - 3 \cdot 3) + (3 \cdot 1 - 1 \cdot 8) \right| = \frac{1}{2}\left| -4 + 47 - 5 \right| = 19.

Worked example: A triangle made by lines

Find the area of the triangle bounded by the lines y=2x−4y = 2x - 4, y=−12x+6y = -\dfrac{1}{2}x + 6 and the yy-axis.

The lines y = 2x − 4 and y = −x/2 + 6 with the y-axis form a triangle.Open in grapher →

The lines cross the yy-axis at (0,−4)(0, -4) and (0,6)(0, 6), so one side lies along the yy-axis with length 1010. They meet where 2x−4=−12x+62x - 4 = -\dfrac{1}{2}x + 6, so 52x=10\dfrac{5}{2}x = 10 and x=4x = 4. The height from that vertex to the yy-axis is 44. The area is 12⋅10⋅4=20\dfrac{1}{2} \cdot 10 \cdot 4 = 20.

(Check: the slopes 22 and −12-\dfrac{1}{2} multiply to −1-1, so the triangle has a right angle at (4,4)(4, 4). Its legs run to (0,−4)(0, -4) and (0,6)(0, 6), with lengths 16+64=80\sqrt{16 + 64} = \sqrt{80} and 16+4=20\sqrt{16 + 4} = \sqrt{20}. The area is 128020=121600=20\dfrac{1}{2}\sqrt{80}\sqrt{20} = \dfrac{1}{2}\sqrt{1600} = 20.)

Worked example: Lattice points

How many lattice points lie on the segment from (0,0)(0, 0) to (12,18)(12, 18), including the endpoints?

gcd⁡(12,18)=6\gcd(12, 18) = 6, so the segment splits into 66 equal steps of (2,3)(2, 3): (0,0),(2,3),(4,6),…,(12,18)(0,0), (2,3), (4,6), \dots, (12,18). That's 6+1=76 + 1 = 7 lattice points.

Common mistake

In the shoelace formula, go around the polygon in order. For a quadrilateral ABCDABCD, use A,B,C,DA, B, C, D, not A,C,B,DA, C, B, D. Sketch the points first so you know the order.

Practice

Practice 1

What is the distance between (1,2)(1, 2) and (9,17)(9, 17)?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

The point (3,5)(3, 5) is reflected over the line y=xy = x, and the result is then reflected over the xx-axis. What are the coordinates of the final point?

Enter a point like (2, -3)

Practice 3

The midpoint of AB‾\overline{AB} is M(3,−1)M(3, -1), and A=(7,4)A = (7, 4). What are the coordinates of BB?

Enter a point like (2, -3)

Practice 4

A line is perpendicular to y=3x+1y = 3x + 1 and passes through (6,2)(6, 2). What is its yy-intercept?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

What is the area of the quadrilateral with vertices (0,0)(0, 0), (6,0)(6, 0), (8,5)(8, 5) and (2,7)(2, 7)?

The quadrilateral with vertices (0, 0), (6, 0), (8, 5) and (2, 7).Open in grapher →

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Three vertices of a parallelogram are (1,1)(1, 1), (5,2)(5, 2) and (3,6)(3, 6). Which of the following could be the fourth vertex?

Practice 7

How many lattice points lie on the segment from (1,1)(1, 1) to (21,31)(21, 31), including both endpoints?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

A rectangle has vertices (0,0)(0, 0), (8,0)(8, 0), (8,6)(8, 6) and (0,6)(0, 6). A line y=mxy = mx with m>0m > 0 cuts the rectangle into two pieces, one with 33 times the area of the other. What is the sum of all possible values of mm?

The rectangle, with y = x/2 shown as one example of a line through the origin.Open in grapher →

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Real contest practice