∑ Basic Mathematics

Menu and settings

Sound
Comfort
Companion color
Theme
Reading panel
Graphics quality

Part III — Coordinate Geometry · Chapter 8

Coordinates and Geometry

Part I gave us numbers, Part II gave us pictures. This chapter welds them together: a point becomes a pair of numbers, a curve becomes an equation, and geometric questions turn into algebra you already know how to do.

A puzzle to carry through the chapter

$3, 4, 5$ are the sides of a right triangle, all whole numbers. So are $5, 12, 13$. Leaving aside scaled-up copies such as $6, 8, 10$ — how many such triangles are there?

  • Just those two
  • A handful — perhaps a dozen
  • Infinitely many

The answer comes out of a circle, in §8.4, along with a recipe for producing them.

By the end of this chapter you can locate points by coordinates and name the quadrants, derive and use the distance formula, recognize and manipulate the equation of a circle in both center–radius and expanded form, recover a circle's center and radius by completing the square, and generate all the rational points on the unit circle from a single parameter.
Before you start

You should be able to complete the square (Chapter 4) and to state the Pythagorean theorem (Chapter 5). The distance formula and the equation of a circle are those two ideas rewritten in coordinates.

Three quick ones from earlier chapters, to wake up what this chapter stands on. They are not scored. If one doesn't come to you, its solution says where to look.

Complete the square: $x^2 - 6x = (x - 3)^2 + k$. What is $k$?

Answer: $k = -9$

$(x-3)^2 = x^2 - 6x + 9$, so $x^2 - 6x = (x-3)^2 - 9$. See §4.2 — it is used twice over in §8.3 to find the center of a circle.

A right triangle has legs $6$ and $8$. How long is the hypotenuse?

Answer: $10$

$36 + 64 = 100$, so $c = 10$. The Pythagorean theorem of §5.4 is about to become the distance formula.

How far apart are $-2$ and $4$ on the number line?

Answer: $6$

$|4 - (-2)| = 6$. Distance along a line is the absolute value of a difference (§3.4); the legs of the triangle in §8.2 are measured exactly this way.

8.1 Coordinate systems

Choose a point of the plane and call it the origin, $O$. Through it draw two perpendicular lines, the $x$-axis (horizontal) and the $y$-axis (vertical), and mark each one off as a copy of the real line from Chapter 3, with $O$ at $0$.

Now any point $P$ of the plane determines two numbers: drop a perpendicular to each axis and read off where it lands. We write $P = (x,y)$, the coordinates of $P$. The order matters — $(3,1)$ and $(1,3)$ are different points — which is why $(x,y)$ is called an ordered pair.

The dictionary

Every point of the plane corresponds to exactly one ordered pair of real numbers, and every ordered pair to exactly one point. Geometry on the left, arithmetic on the right — and from here on we translate freely between them.

The two axes cut the plane into four quadrants, numbered counterclockwise from the upper right: I has $x>0, y>0$; II has $x<0, y>0$; III has both negative; IV has $x>0, y<0$. Points on an axis belong to no quadrant. The sign pattern is worth knowing by reflex, since it is the fastest check on an answer's plausibility.

A choice, not a fact

Nothing in the plane singles out an origin or a direction; we chose them. A different choice gives every point different coordinates while leaving all the geometry intact. This is the reason a well-posed problem lets you place the axes — put the origin at the center of the circle, or a vertex of the triangle on the $x$-axis — and a well-chosen placement can cut the algebra in half.

In which quadrant does the point $(5, -2)$ lie?

Answer: quadrant $4$

Positive $x$ puts it to the right of the $y$-axis; negative $y$ puts it below the $x$-axis. Lower right is quadrant IV.

8.2 Distance between points

Chapter 5 ended with a promise: the Pythagorean theorem would give the distance between any two points. Here it is.

How far apart are $(1,1)$ and $(4,5)$? No formula yet: sketch the two points, draw a horizontal leg and a vertical leg between them, and use Chapter 5.Work it out, then open

The horizontal leg runs from $x = 1$ to $x = 4$: length $3$. The vertical leg runs from $y = 1$ to $y = 5$: length $4$. They meet at a right angle, so the distance is the hypotenuse: $\sqrt{3^2 + 4^2} = 5$. The formula below is this calculation with letters in place of the numbers.

Let $P = (x_1,y_1)$ and $Q = (x_2,y_2)$. Complete the right triangle by dropping to the point $R = (x_2, y_1)$, directly below or above $Q$ and level with $P$. The leg $PR$ is horizontal, of length $|x_2 - x_1|$; the leg $RQ$ is vertical, of length $|y_2 - y_1|$; and the angle at $R$ is right, because one leg is horizontal and the other vertical.

The distance formula

$$d(P,Q) = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.$$

The absolute values have quietly vanished, because $|a|^2 = a^2$. That also means the order of subtraction does not matter — as it had better not, since $d(P,Q) = d(Q,P)$.

The formula is a right triangle. Drag either point. The dashed legs are the coordinate differences; the solid line is the hypotenuse. Every use of the distance formula is this picture, whether or not you draw it.

Example 1. A distance, and a use for it

Find the distance between $A = (-2,3)$ and $B = (4,-5)$, and decide whether the triangle $A$, $B$, $C = (4,3)$ is a right triangle.

  1. $\Delta x = 4 - (-2) = 6$ and $\Delta y = -5 - 3 = -8$.
  2. $AB = \sqrt{6^2 + (-8)^2} = \sqrt{36+64} = \sqrt{100} = 10$.
  3. Now the other two sides. $AC$: same $y$, so it is horizontal of length $6$. $BC$: same $x$, so it is vertical of length $8$. When two points share a coordinate, do not reach for the formula — just subtract.
  4. $6^2 + 8^2 = 100 = 10^2$, so by the converse of the Pythagorean theorem the triangle has a right angle at $C$. $\blacksquare$

Which was visible from the start: $AC$ is horizontal and $BC$ is vertical, so they are perpendicular. The arithmetic confirmed what the coordinates had already said.

What is the distance between $(-1,-2)$ and $(2,2)$?

Answer: $5$

$\Delta x = 2 - (-1) = 3$ and $\Delta y = 2 - (-2) = 4$, so $d = \sqrt{9 + 16} = 5$. Subtracting a negative coordinate is where the slips happen.

One more dimension

Nothing above needed the page to be flat. Stand a third axis upright at the origin, the $z$-axis, perpendicular to both the $x$-axis and the $y$-axis. The first two axes now lie on a floor, and $z$ measures height above it.

A point $Q$ in space is then three numbers, $Q = (x, y, z)$: walk $x$ along the first axis, $y$ parallel to the second, then climb $z$. The point $R = (x, y, 0)$ on the floor directly below $Q$ is its shadow, and the straight line from $O$ to $Q$ is the long diagonal of a box whose sides are $x$, $y$ and $z$.

A box is $4$ by $3$ by $2$. Is its long diagonal longer or shorter than $5$?Decide, then open

Longer. The diagonal of the floor alone is already $\sqrt{4^2 + 3^2} = 5$. The long diagonal is the hypotenuse of a right triangle standing on that floor diagonal, with the height $2$ as its other leg, so it is $\sqrt{25 + 4} = \sqrt{29} \approx 5.39$. A hypotenuse is longer than either leg.

That is the whole method: the Pythagorean theorem twice. On the floor, the triangle with corners $O$, $(x, 0, 0)$ and $R$ has a right angle, so $OR^2 = x^2 + y^2$. The segment $RQ$ is vertical and $OR$ lies in the floor, so the triangle $O$, $R$, $Q$ has a right angle at $R$, and $OQ^2 = OR^2 + z^2 = x^2 + y^2 + z^2$. The distance from the origin is $\sqrt{x^2 + y^2 + z^2}$, the formula of this section with one more square under the root.

The Pythagorean theorem twice. Move $Q$ with the sliders, or drag it along one of its guide lines; drag anywhere else to turn the box. The triangle on the floor gives $OR$, and the triangle standing on $OR$ gives $OQ$.

Move $Q$ until it is exactly $7$ from the origin, then press Check.

Answer: $Q = (2, 3, 6)$, in any order

We need $x^2 + y^2 + z^2 = 49$. The largest square below $49$ is $36 = 6^2$, which leaves $13$ for the other two, and $13 = 4 + 9$. So $Q = (2, 3, 6)$, or the same three numbers in any order. On the floor $OR^2 = 2^2 + 3^2 = 13$; standing up $OQ^2 = 13 + 6^2 = 49$, so $OQ = 7$.

The floor diagonal is $\sqrt{13}$, not a whole number, and it does not need to be: only the squares are added, so the root is taken once, at the end.

Drag $A$ and $B$ until they are exactly $10$ apart, then press Check.

Answer: any pair with $\Delta x^2 + \Delta y^2 = 100$

For example $A = (-4, -3)$ and $B = (4, 3)$: the legs are $8$ and $6$, and $\sqrt{64 + 36} = 10$.

8.3 The equation of a circle

A circle with center $C$ and radius $r$ is the set of points at distance exactly $r$ from $C$. That is a sentence about distance, and we now have distance as a formula — so the sentence becomes an equation.

With $C = (h,k)$ and a typical point $(x,y)$, the condition $d\bigl((x,y),(h,k)\bigr) = r$ reads

$$\sqrt{(x-h)^2 + (y-k)^2} = r,$$

and squaring both sides — harmless here, since both sides are $\ge 0$ — gives:

Equation of a circle

$$(x-h)^2 + (y-k)^2 = r^{2}.$$ Centered at the origin this is simply $x^2 + y^2 = r^2$.

Center, radius, equation. Move the center and change the radius, and watch both forms of the equation update. Note the sign convention: a center at $x = 3$ appears in the equation as $(x - 3)$.
The sign trap

$(x-h)$ contains minus $h$. So $(x-3)^2 + (y+2)^2 = 25$ is the circle of radius $5$ centered at $(3,-2)$ — not $(3,2)$, and not $(-3,2)$. Read $(y+2)$ as $(y - (-2))$ every time until it stops needing thought.

Wrong turn. Copying the center's signs straight in

Write the equation of the circle of radius $5$ centered at $(3, -2)$.

  1. The tempting move. The center is $(3,-2)$, so copy those numbers in as they stand: $(x-3)^2 + (y-2)^2 = 25$.
  2. The check. The left side measures the squared distance from the center, so putting the intended center into it must give $0$. Substituting $(3,-2)$: $(3-3)^2 + (-2-2)^2 = 0 + 16 = 16$, not $0$. The intended center does not even sit at the middle of the circle that was written down.
  3. Why. The template is $(x-h)^2 + (y-k)^2 = r^2$, and $k = -2$ here, so the second pair of parentheses is $\bigl(y - (-2)\bigr) = (y+2)$. The equation written above has $k = +2$: it is the circle centered at $(3, 2)$, a reflection of the one wanted.
  4. The repair. $(x-3)^2 + (y+2)^2 = 25$. Substituting the center now gives $0 + 0 = 0$ ✓, and a point that should be on the circle, say $(3, 3)$ — five units straight up from $(3,-2)$ — gives $0 + 25 = 25$ ✓. $\blacksquare$

The substitution in step 2 is worth keeping as a habit: the center is the one point whose coordinates must make the left side vanish, so it costs a few seconds to confirm you wrote down the circle you meant.

What is the center of the circle $(x+4)^2 + (y-1)^2 = 9$?

Answer: $(-4, 1)$

Matching $(x - h)^2 + (y - k)^2 = r^2$: $h = -4$ and $k = 1$. Check by substituting: the center must make the left side $0$, and $(-4 + 4)^2 + (1 - 1)^2 = 0$ ✓. The radius is $3$.

Expanding the equation gives $x^2 + y^2 - 2hx - 2ky + (h^2+k^2-r^2) = 0$: something of the shape $x^2 + y^2 + Dx + Ey + F = 0$. Going back the other way — from the expanded form to the center and radius — is completing the square from Chapter 4, done once in $x$ and once in $y$.

Example 2. Recovering the center and radius

Describe the set of points satisfying $x^2 + y^2 - 6x + 4y - 12 = 0$.

  1. Group the $x$'s and the $y$'s, and move the constant across: $$(x^2 - 6x) + (y^2 + 4y) = 12.$$
  2. Complete the square in $x$: half of $-6$ is $-3$, and $(x-3)^2 = x^2 - 6x + 9$. So $x^2-6x = (x-3)^2 - 9$.
  3. And in $y$: half of $4$ is $2$, so $y^2+4y = (y+2)^2 - 4$.
  4. Substituting: $(x-3)^2 - 9 + (y+2)^2 - 4 = 12$, that is, $$(x-3)^2 + (y+2)^2 = 25.$$
  5. A circle with center $(3,-2)$ and radius $5$. $\blacksquare$

If the right-hand side had come out negative, no point would satisfy the equation; if zero, only the center itself. The discriminant idea from Chapter 4, wearing different clothes.

Your turn, with help. Center and radius from the expanded form

Describe the set of points satisfying $x^2 + y^2 + 2x - 10y + 1 = 0$. Try each step before opening it.

  1. Group the $x$'s and the $y$'s, and move the constant across: $(x^2 + 2x) + (y^2 - 10y) = -1$.
  2. Complete the square in each variable

    $x^2 + 2x = (x+1)^2 - 1$, and $y^2 - 10y = (y-5)^2 - 25$.

  3. Substitute and tidy up

    $(x+1)^2 - 1 + (y-5)^2 - 25 = -1$, so $(x+1)^2 + (y-5)^2 = 25$.

  4. Read off the answer

    A circle with center $(-1, 5)$ and radius $5$. $\blacksquare$

The equation $x^2 + y^2 - 4x = 5$ describes a circle. What is its radius?

Answer: $3$

$x^2 - 4x = (x-2)^2 - 4$, so the equation becomes $(x-2)^2 + y^2 = 9$: center $(2,0)$, radius $\sqrt9 = 3$.

Slicing a sphere

The circle sentence does not care how many coordinates there are. In space, with the distance from One more dimension, the points at distance exactly $R$ from the origin $O$ satisfy $\sqrt{x^2 + y^2 + z^2} = R$, and squaring gives

$$x^2 + y^2 + z^2 = R^2.$$

This is the sphere with center $O$ and radius $R$: the surface of a ball, not its inside.

Now cut it with a level sheet, the points at height $c$, which is the plane $z = c$. A point on both has its $z$ fixed at $c$, so the sphere's equation becomes $x^2 + y^2 + c^2 = R^2$, that is $x^2 + y^2 = R^2 - c^2$. Inside the plane that is the equation of a circle centered on the $z$-axis, with radius $\sqrt{R^2 - c^2}$.

A sphere of radius $5$ is cut by the plane $z = 3$, three-fifths of the way from the center to the top. Is the circle it cuts out more or less than three-fifths as wide as the sphere?Decide, then open

More, by a lot. The slice is $x^2 + y^2 = 25 - 9 = 16$, a circle of radius $4$: four-fifths of the sphere's radius, not three-fifths. Near its middle a sphere stands almost upright, so climbing barely narrows it; the narrowing crowds in near the top, where the last unit of height, from $z = 4$ to $z = 5$, takes the radius from $3$ all the way to $0$.

The picture behind the algebra is one right triangle. Go from $O$ up the $z$-axis to the center $(0, 0, c)$ of the slice, then straight across the plane to a point of the circle. The first leg is vertical and the second lies in a level plane, so the angle between them is right; the hypotenuse runs from $O$ to a point of the sphere, so it is $R$. Calling the slice's radius $r$, the Pythagorean theorem gives $r^2 + c^2 = R^2$, the same equation again. As for the circle in Example 2: if $c^2 = R^2$ only one point is left, the top or the bottom of the sphere, and if $c^2 > R^2$ the plane misses the sphere altogether.

A circle one dimension up. Move the plane with the slider, or drag its handle up and down; drag anywhere else to turn the sphere. The triangle from the center has hypotenuse $R = 5$ and legs $c$ and $r$, so the slice at height $c$ has $r^2 = 25 - c^2$.

The sphere is ${x^2 + y^2 + z^2 = 25}$. Slide the plane to a height where the slice is ${x^2 + y^2 = 9}$, then press Check.

Answer: $z = 4$ or $z = -4$

On the plane $z = c$ the sphere's equation becomes $x^2 + y^2 = 25 - c^2$. For that to be $x^2 + y^2 = 9$ we need $25 - c^2 = 9$, so $c^2 = 16$, and $c = 4$ or $c = -4$.

In the picture: the triangle from the center has hypotenuse $5$ and a horizontal leg of $3$, the slice's radius, so its vertical leg is $\sqrt{25 - 9} = 4$, pointing up or down. The two slices are mirror images of each other in the floor $z = 0$.

The circle $(x - 3)^2 + (y + 1)^2 = 16$ has center $($ $,$ $)$ and radius .

Answer: center $(3, -1)$, radius $4$

$y + 1 = y - (-1)$, so $k = -1$; and $r^2 = 16$ gives $r = 4$.

8.4 Rational points on a circle

Here is a question that looks like geometry and turns out to be about numbers. Which points of the unit circle $x^2 + y^2 = 1$ have both coordinates rational?

A few are easy: $(1,0)$, $(0,1)$, $(-1,0)$, and $\left(\tfrac35,\tfrac45\right)$ — that last one being the $3,4,5$ triangle in disguise. Are there others? Infinitely many, and there is a way to produce every one of them.

Example 3. Sweeping a line through a known point

Start at the known rational point $N = (-1, 0)$ and draw the line through it of slope $t$. Find its second intersection with the circle.

  1. The line is $y = t(x+1)$. Substitute into $x^2 + y^2 = 1$: $$x^2 + t^2(x+1)^2 = 1.$$
  2. Move everything to one side: $x^2 - 1 + t^2(x+1)^2 = 0$, and since $x^2 - 1 = (x+1)(x-1)$, the factor $(x+1)$ is common: $$(x+1)\bigl[(x-1) + t^2(x+1)\bigr] = 0.$$ The factor $(x+1)$ had to appear: we knew $x=-1$ was a solution, because the line was built to pass through $N$.
  3. The other root comes from $(x-1) + t^2(x+1) = 0$, i.e. $x(1+t^2) = 1 - t^2$, so $$x = \frac{1-t^2}{1+t^2}.$$
  4. Then $y = t(x+1) = t\left(\frac{1-t^2}{1+t^2} + 1\right) = \frac{2t}{1+t^2}$.
  5. So for every $t$, $$\left(\frac{1-t^{2}}{1+t^{2}},\; \frac{2t}{1+t^{2}}\right)$$ lies on the circle — and if $t$ is rational, both coordinates are. $\blacksquare$

Use the parametrization with $t = 2$. Which point of the unit circle do you get?

Answer: $\left(-\tfrac35, \tfrac45\right)$

$1 + t^2 = 5$ and $1 - t^2 = -3$, so $x = -\frac35$ and $y = \frac45$. Check: $\frac{9}{25} + \frac{16}{25} = 1$ ✓. A steep line from $(-1,0)$ lands in quadrant II — and it is the $3,4,5$ triangle again.

Two things deserve a second look. First, the construction catches every rational point except $N$ itself: given such a point, the line joining it to $N$ has rational slope $t = y/(x+1)$, and that $t$ produces it. Second, clearing denominators in $x^2 + y^2 = 1$ with $t = q/p$ gives

$$(p^2 - q^2)^2 + (2pq)^2 = (p^2+q^2)^2,$$

which is a formula for Pythagorean triples. Taking $p=2, q=1$ gives $3,4,5$; $p=3,q=2$ gives $5,12,13$. A question about fractions on a circle has produced every right triangle with whole number sides.

Why this is a big deal

The method — take one known rational point, sweep lines through it, and read off the second intersection — is the first step of a subject called arithmetic geometry. It works because a line meets a conic twice, so knowing one rational intersection forces the other to be rational too. For curves of higher degree the trick breaks down spectacularly, and what replaces it is still an area of active research.

Practice

Write points as pairs, like (3,-2).

What is the distance between $(1,2)$ and $(4,6)$?

Answer: $5$

$\Delta x = 3$, $\Delta y = 4$, so $d = \sqrt{9+16} = \sqrt{25} = 5$ — the $3,4,5$ triangle, placed on the grid.

In which quadrant does $(-3, 7)$ lie?

Answer: quadrant $2$

Negative $x$, positive $y$ — upper left, which is quadrant II. Quadrants are numbered counterclockwise from the upper right.

What is the center of the circle $(x-2)^2 + (y+5)^2 = 9$?

Answer: $(2,-5)$

Matching against $(x-h)^2 + (y-k)^2 = r^2$: $h = 2$, and since $(y+5) = (y-(-5))$ we get $k = -5$. The radius is $\sqrt9 = 3$ — the equation holds $r^2$, not $r$.

The equation $x^2 + y^2 - 2x + 8y + 1 = 0$ describes a circle. What is its radius?

Answer: $4$

Group and complete the square: $$(x^2-2x) + (y^2+8y) = -1$$ $$(x-1)^2 - 1 + (y+4)^2 - 16 = -1$$ $$(x-1)^2 + (y+4)^2 = 16.$$ So the center is $(1,-4)$ and the radius is $\sqrt{16} = 4$.

The point $(x, 3)$ lies in the first quadrant, at distance $5$ from the origin. What is $x$?

Answer: $4$

The distance formula gives $\sqrt{x^2 + 3^2} = 5$. Both sides are non-negative, so squaring loses nothing: $x^2 + 9 = 25$, hence $x^2 = 16$ and $x = \pm 4$.

The first quadrant has $x > 0$, so $x = 4$. (The other root, $x = -4$, is the mirror image in quadrant II — also at distance $5$, since the formula only sees $x^2$.)

Does the point $(6,2)$ lie inside, on, or outside the circle $(x-2)^2 + (y+1)^2 = 25$?

  • Inside.
  • On the circle.
  • Outside.
  • Cannot be determined from the equation.

Answer: on the circle

Substitute: $(6-2)^2 + (2+1)^2 = 16 + 9 = 25$, which is exactly $r^2$. So the point is at distance $5$ from the center $(2,-1)$ — on the circle.

In general: substitute and compare with $r^2$. Less means inside, more means outside.

How far apart are $(-4,7)$ and $(6,7)$?

Answer: $10$

The $y$-coordinates agree, so the segment is horizontal and the distance is $|6 - (-4)| = 10$. The formula gives the same thing: $\sqrt{10^2 + 0^2} = 10$.

Using the parametrization of §8.4 with $t = \tfrac12$, which rational point of the unit circle do you get?

Answer: $\left(\tfrac35, \tfrac45\right) = (0.6, 0.8)$

With $t = \tfrac12$: $1 + t^2 = \tfrac54$ and $1 - t^2 = \tfrac34$, so $$x = \frac{3/4}{5/4} = \frac35, \qquad y = \frac{2\cdot\frac12}{5/4} = \frac{1}{5/4} = \frac45.$$

Check: $\left(\tfrac35\right)^2 + \left(\tfrac45\right)^2 = \tfrac{9+16}{25} = 1$ ✓.

A circle has center $(2,-3)$ and passes through $(14,2)$. What is its radius?

Answer: $13$

The radius is the distance from the center to that point: $$r = \sqrt{(14-2)^2 + (2-(-3))^2} = \sqrt{144 + 25} = \sqrt{169} = 13.$$ The circle's equation is therefore $(x-2)^2 + (y+3)^2 = 169$.

Why is squaring both sides of $\sqrt{(x-h)^2 + (y-k)^2} = r$ safe here, when squaring an equation is usually a way to introduce false solutions?

  • Because $r$ is a whole number.
  • Because squaring is always reversible.
  • Because both sides are non-negative, so equality of the squares forces equality of the originals.
  • Because the equation has two unknowns rather than one.

Answer: because both sides are non-negative

Squaring loses information about sign: $a^2 = b^2$ gives $a = \pm b$. But a square root is $\ge 0$ and a radius is $> 0$, so the minus case cannot occur and nothing is gained or lost. Squaring $x = -2$, by contrast, produces $x^2 = 4$, which also admits $x = 2$.

A room is $9$ m long, $6$ m wide and $2$ m high. How long is the straight line from a floor corner to the opposite ceiling corner?

Answer: $11$ m

The diagonal of the floor has square $9^2 + 6^2 = 81 + 36 = 117$. That diagonal and the height $2$ are the legs of a right triangle standing on the floor, so the long diagonal is $$\sqrt{117 + 2^2} = \sqrt{121} = 11.$$ In one line: $\sqrt{9^2 + 6^2 + 2^2} = 11$. The floor diagonal $\sqrt{117}$ is never needed as a decimal; only its square is used.

Recap

Back to the puzzle

Infinitely many. Every rational slope $t = q/p$ gives a rational point $\left(\frac{1-t^2}{1+t^2}, \frac{2t}{1+t^2}\right)$ on the unit circle, and clearing denominators turns it into the whole-number triangle $p^2 - q^2,\; 2pq,\; p^2 + q^2$. Take $p = 4$, $q = 1$ and you get $15, 8, 17$; $p = 4$, $q = 3$ gives $7, 24, 25$. Different slopes give genuinely different triangles, and there is no end to the slopes.

  • A choice of origin and axes turns each point into an ordered pair, and lets every geometric statement be rewritten as algebra.
  • $d = \sqrt{(\Delta x)^2 + (\Delta y)^2}$ — the Pythagorean theorem with the legs read off the coordinates.
  • "Distance from $(h,k)$ equals $r$" becomes $(x-h)^2 + (y-k)^2 = r^2$; mind the minus signs.
  • Completing the square in $x$ and in $y$ converts $x^2+y^2+Dx+Ey+F=0$ back into center and radius.
  • Sweeping lines of rational slope through $(-1,0)$ generates every rational point of the unit circle — and every Pythagorean triple with it.