# Tips for choosing coordinates of three points such that the coordinates of the orthocenter are integers

I want to give my students the coordinates of three points and ask them to find the coordinates of the orthocenter. This is a fairly long problem that can involve finding the equations of the altitudes and then finding their intersection.

A long problem needs to run fairly smoothly, because if we hit a bump we might not sort it all out before the dismissal bell. And then, I think, the time was not very productive.

I can pick the original six coordinates so that the equations of all three sides of the triangle have intercepts that are integers. But so far I have not figured out how to make the coordinates of the orthocenter integers.

Recently I asked such a question here, and some helpful person responded that anyone teaching my subject ought to be able to answer such a question himself. So I would remind this helpful person that I have not despaired of finding an answer myself. But life is short, and I hope that someone out there (probably a real math teacher) has already done the work.

An explicit formula for the orthocenter as a function of the three vertices $(x_i,y_i)$, $i=1,2,3$, can be found on Quora, derived by Shambhu Bhat. The orthocenter coordinates are $(o_x,o_y)$, where $o_x=x_{num}\,/\,denom$ and $o_y=y_{num}\,/\,denom$. Here the three quantities $x_{num},\, y_{num},\, denom$ are each $2 \times 2$ determinants. The key for integer solutions is the common denominator: $$denom \;=\; \left| \; \begin{array}{cc} {x_3}-{x_2} & {y_3}-{y_2} \\ {x_3}-{x_1} & {y_3}-{y_1} \\ \end{array} \; \right| \;.$$ In the example below, $x_{num},\, y_{num},\, denom \;=\; -240,\, -210,\, -80$, yielding $(o_x,o_y) = (3,\frac{21}{8})$.

Vertex coordinates: $(0,0), (10,0), (3,8) \rightarrow (3,\frac{21}{8})$.
Because the denominator is $80$, scaling the coordinates by $80$ is guaranteed to yield integer coordinates for the orthocenter. Of course often there are cancellations. In this case, multiplying by $8$ would suffice, leading to vertices $(0,0), (80,0), (24,64)$ and orthocenter $(24,21)$.

So: Choose three integer-coordinate vertices. Compute $denom$, scale the coordinates by $denom$. Or, if you want the smallest scaling, go through the calculations to compute the orthocenter exactly (see the link for the numerator determinants), and then use the LCM of the denominators of the orthocenter coordinates, just as user Acccumulation suggests.

The coordinates will be rational numbers, so you just have to pick arbitrary points, then scale by the LCD. This quora question has several answers for what the formula for the orthocenter is; I haven't verified any of them. If you do have a closed form formula, you can then find a formula for the LCM of all denominators, and then look for numbers that yield one.

• Can you elaborate? Suppose I pick the vertices (3,5),(7,11) and (13,17). The denominators of the slopes of the altitudes will be 17-11=6, 11-5=6, and 17-5=12; the LCM of those numbers is 12. Do I scale by 12 or by the LCM of the original 6 coordinates? What does it mean to "scale" by a number? And what does it mean for numbers to "yield one"? – Chaim Jan 24 '18 at 21:03
• Find the LCD between the x and y coordinates of the orthocenter. Multiply the coordinates of the original three points by that number. You should get a new set of numbers whose orthocenter has integer coordinates. By "yield one", I mean "When you look at the LCM of the denominators, you want that number to be one". Having LCM of denominators be one is the same as being integers. – Acccumulation Jan 24 '18 at 21:32

I often create problem sets using Excel. I wrote the follow suggestion as a recipe easily developed in Excel. Wherever the digit 1, 2 or 3 follows a letter immediately, the intention is a subscript. The sole exponent in this entire answer is indicated by a caret followed by a 2 like this: ^2. Here I define some of the subscripted symbols:

x1, y1: The x and y coordinates of Point 1.
x2, y2: The x and y coordinates of Point 2.
x3, y3: The x and y coordinates of Point 3.
m1, b1: The slope and intercept of the altitude to Point 1
m2, b2: The slope and intercept of the altitude to Point 2.
m3, b3: The slope and intercept of the altitude to Point 3.


Pick k1, k2, k3. Do not pick k1=1.

Let k4=(k2)^2

Pick d.

Let e=k3*(1-k1)

Let f=[(1+k1)/(1-k1)]*e

Define the vertices of the triangle as follows:

        x        y
Point 1 k4(f)   k2(d)
Point 2 k4(e+f) k2(d+e)
Point 3 k4(e)   k2(d+e+f)


The altitudes through these vertices can be computed as follows.

Altitudes through… y = m                 x + b
Point 1            y = (x2 – x3)/(y3-y2) x + (y1 – x1(x2 – x3)/(y3-y2))
Point 2            y = (x1 – x3)/(y3-y1) x + (y2 – x2(x1 – x3)/(y3-y1))
Point 3            y = (x1 – x2)/(y2-y1) x + (y3 – xC(x1 – x2)/(y2-y1))


Orthocenter’s x-coordinate: (b1-b2)/(m2-m1)

If all picks are integers, then all of following will also be integers: the coordinates of the vertices, the altitudes’ slopes, the altitudes’ intercepts, and the coordinates of the orthocenter. The slopes of the altitudes through Points 1, 2 and 3 will respectively be (k2), (k1*k2), and (-1*k2). Therefore if k2=1, the triangle will be a right triangle, the altitudes to Points 1 and 3 will be perpendicular, and the orthocenter will be Point 2.