4

I'm trying to implement Bresenham's Circle drawing algorithm and I intend to draw a circumscribed and inscribed circle (circumcircle and incircle) in a triangle. I need some simple ways to find coordinates of an equilateral triangle to test my code.

Any help will be appreciated. Thanks.

NATHAN
  • 1

5 Answers5

5

Unfortunately, the coordinates of the vertices of an equilateral triangle can't all be integers. As dxiv pointed out, this is because $\sqrt 3$ is irrational. If it doesn't have to be exactly equilateral, you could have e.g. circumcentre (0, 0), radius 5, points $(0, 5), (\pm 4, -3)$. The angles are about $73.7^\circ, 53.1^\circ, 53.1^\circ$. A triangle which is closer to being equilateral has circumcentre $(0, 0)$, radius 89 and points $(0, 89)$, $(\pm 80, 39)$. The angles are about $64^\circ, 58^\circ, 58^\circ$.

If the circumcentre's coordinates don't have to be integers, then there are triangles with lower integer coordinates which are better approximations to equilateral triangles, e.g. where the vertices' coordinates are $(0, 0), (x, y), (y, x)$ where $\frac{y}x\approx \arctan \frac{\pi}{12}$, e.g.

  • $(4,1)$ with angles $62^\circ, 59^\circ, 59^\circ$
  • $(15,4)$ with angles $60.137^\circ, 59.931^\circ, 59.931^\circ$
  • $(56,15)$ with angles $60.010^\circ, 59.995^\circ, 59.995^\circ$
Rosie F
  • 3,231
4

Here's a proof that if a triangle's vertices' coordinates are integers, then it is not equilateral.

Suppose that such a triangle $ABC$ were equilateral, with every side of length $l$, and with $l$ minimal given these conditions. If $4\mid l^2$ then all the $x$-coordinates have the same parity, and all the $y$-coordinates have the same parity, so we may translate $ABC$ if necessary so that all the coordinates are even, then shrink it linearly by a factor of $2$, contradicting minimality of $l$.

So $4\nmid l^2$.

By the pigeonhole principle, at least two of the vertices have $x$-coordinates of the same parity. Pick two such and label them $A$ and $B$, and the other vertex $C$. Likewise, at least two of the vertices have $y$-coordinates of the same parity. If $A$ and $B$ were such, then $4\mid l^2$, which has been shown to be false. So wlog $A$ and $C$ have $y$-coordinates of the same parity. Then $|BC|^2$ is even but $|AB|^2$ and $|AC|^2$ are odd, so $ABC$ is not equilateral.

Alternative proof

Again suppose $l$ minimal. Chequer the lattice points. If $l^2$ is odd, every two vertices have different colours. But, by the pigeonhole principle, at least two must have the same colour. So $l^2$ is even, so all vertices have the same colour, and thus lie on the coarser lattice of points of that colour. Thus a linear transform $\mathbf{T}$ may be applied which maps this coarse lattice onto the original. $\mathbf{T}$ rotates by $45^\circ$, preserves angles and halves areas, yielding a smaller example. This contradicts minimality of $l$.

Rosie F
  • 3,231
  • Nice one. What about approaching by area? All integer vertices give integer area but area of equilateral triangle is never integral (numerically). Hence contradiction.. :-) – Soham Apr 14 '18 at 07:19
  • @tatan But proving that would need trig, like your and dxiv's proofs ($\sin \frac{\pi}3=\frac{\sqrt 3}2$). I thought a proof which involved only number theory of integers and no trig would be nice. – Rosie F Apr 14 '18 at 08:18
  • Yeah... therein lies the elegance of number theory ;-) – Soham Apr 14 '18 at 17:19
2

It is possible, the coordinates (a,0,0), (0,a,0) and (0,0,a) (where a is an integer) form an equilateral triangle.

arihant
  • 21
1

This is not possible.Let me try to explain this simply.

Draw an equilateral triangle $ABC$. Arrange your own coordinate system in such a way that $B$ is $(0,0)$ and side $BC$ coincides with $X$ axis. Note that this does not affect the generality of the proof in any way.

Now, drop a perpendicular from $A$ to $BC$ at a point $D$ on $BC$.

Arbitrarily assume side of the equilateral triangle to be $a$.

So, now, applying simple trigonometric ratios we see that $BD=a/2$ and $AD=\frac{\sqrt3}{2}a$.

So,the coordinates of $A$ are $(a/2,\frac{\sqrt3}{2}a)$. So, not that it is not possible to simultaneously make the $x$ and $y$ coordinates rational, let alone integral.

enter image description here Hope this helps!

Soham
  • 10,120
  • 1
    "Note that this does not affect the generality of the proof in any way." Yes it does. Your proof does not rule out the existence of an equilateral triangle with integer vertices where $C$ is not on the $x$-axis. –  Apr 14 '18 at 06:42
  • 1
    @Rahul I don't think there is any particular rule for assigning any axis. I take a set of perpendicular system any way I wish... – Soham Apr 14 '18 at 07:16
  • 1
    In most geometry problems, you're allowed to choose a coordinate system because the choice doesn't affect distances or angles. But it does affect whether or not the coordinates are integers, which is what's important in this problem. –  Apr 14 '18 at 12:33
0

Pick's Theorem implies that a triangle with lattice point vertices has rational area. The area of such an equilateral triangle is a rational multiple of the square root of $3$.

Ethan Bolker
  • 103,433