# Is it possible for a right triangle whose vertices are lattice points to have legs that aren't parallel to the axes?

This is a problem from Apostol calculus vol I. It originally asks to prove that the area of any right triangle with vertices at lattice points have area given by $$Z+\frac12B-1$$ where $$Z$$ is the number of lattice points lying inside the triangle, $$B$$ the number of lattice points lying on the perimeter.

It is particularly easy to prove that if the triangle has the perpendicular and base parallel to the axes.

My question is:

Is it at all possible for triangles with lattice points as vertices to have a different configuration of the sides (i.e., base and perp. not parallel to the axes)? If not, how do i prove it?

• Hint: Perpendicular lines have negative-reciprocal slopes.
– Blue
Jan 22 at 17:30
• Something like $(0,0), (2,1), (-1,2)$? Jan 22 at 17:39
• @Blue So if (x1,y1), (x2,y2) and (x3,y3) are the points then [(y1-y2)/(x1-x2)]*[(y3-y2)/(x3-x2)]=-1 . This means y3-y2=-(x3-x2)(x1-x2)/(y1-y2). There seems to be infinite possibilities for integer (x,y) Jan 22 at 17:53
• @Suprativ: I'm not sure I understand your concern. If there are "infinite possibilities", then your question is answered overwhelmingly in the affirmative. (Note that there are "infinite possibilities" for right triangles whose legs are parallel to the axes, too.)
– Blue
Jan 22 at 18:00
• The Wikipedia article Pick's theorem is the general case. Jan 22 at 18:25

Yes, it is possible. The site provides pictures of 14 examples when each coordinate of two vertices lies between 0 and 2 inclusive. There are two examples where perpendicular sides are not parallel to the axes. It is possible for a Pythagorean triple if all sides are multiples of some valid hypotenuse, the primitive values of which are listed here.

One that comes to mind is $$\space(75,100,125)=25\times(3,4,5)\space$$ and $$(21^2+72^2=45^2+60^2=75^2)\\ (28^2+96^2=60^2+80^2=100^2)\\ (75^2+100^2=117^2+44^2=125^2)$$ The area is $$\space 3750.\quad$$ If one vertex is at the origin $$\space (0,0)\space$$ and another at $$\space (60,45),\space$$ the third vertex can be at $$(-60,80),\space (0,125),\space (60,-80), \text{or }(120,-35).\quad$$ The drawing below shows $$\space 4\space$$ possible locations of the long leg, and $$\space 2 \space$$ locations for a hypotenuse not aligned with the axes. I don’t know how to find the number of internal lattice points but I believe, for the perimeter, it is $$\space3\cdot 25=75.$$

There are infinite other solutions and they only need to meet the restrictions in the first sentence above. • It's easier than that: nothing in the problem statement requires the side lengths to be integers or even that they be commensurable. Jan 23 at 16:12
• @David K The use of Pythagorean triples (integer sides) simply makes it unmistakeable that solutions exist. Jan 23 at 16:22
• Just take $(0,0),$ $(p,q),$ $(-q,p)$ for any non-zero integers $p,q.$ Use the inner product (or observe that one slope is the negative reciprocal of the other) to confirm that two sides are orthogonal. Jan 23 at 16:26