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?

 A: 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.

A: 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.

