Geometry question - constructing an integer triangle in 3 dimensions

I’m learning about descriptive geometry, which uses compass/straightedge techniques to do some nifty things like figure out intersections of cones with cones and find the shortest distance between solids in space. I’m trying to construct a problem for myself, and stumbled into what seems like a deeper question.

I’d like to construct a triangle ABC in 3D space, where the x,y, and z coordinates of each corner are unique integers - no two x the same, no two y, no two z - but also each side length AB, BC, CA is a unique integer. It’s easy to make one edge: use two Pythagorean triples that share one side length to get the diagonal of a prism. So points (0,0,0) and (3,4,12) give you a diagonal of length 13. It seems to me that you could extend this to two more prisms somehow to get the third point of the triangle, but I got lost in a bunch of simultaneous equations.

Is such a triangle possible? Does it have a name? If three different integer side lengths aren’t possible, how about two?

ETA: put another way, is there a way to rotate an integer triangle in space such that the vertices are on integer coordinates?

I certainly don’t see any way to answer the question, but I can get 2, using the same method one can use to get the first one. The reason (3,4,12) works is that 3*2+4^2=5^2 and 5^2+12^2=13^2. So starting with 5^2+12^2=13^2 and 13^2+84^2=85^2, you conclude that 5^2+12^2+84^2=85^2, so that (5,12,84) is also an integer distance from the origin. You can get as many such examples as you like, Hint: It is no accident that 12+13=5^2 and 84+85=13^2. But the line from (3,4,12) to (5,12,84) does not have an integer length and I see no systematic way to find triangles like that that do.

I need a free minute to work it out but it seems this is at least a variation on finding a Euler brick.

Yes, I believe a solution here would likely qualify as a perfect cuboid:

Thanks for the answers thus far - the idea of the Euler brick or a perfect cuboid is on the right track. Those references also led me to the Pythagorean quadruples, which I’m looking into a bit more.

The triangle that’s made by the face diagonals of a Euler brick doesn’t meet my starting criteria, though, because the brick is squared up to the axes: the corners are going to share an x, y, or z value with each other. I’m looking for a brick that is rotated in such a way that that doesn’t happen but keeps the corners on integer values. Can that be done? If we go with a rotated brick of some sort, I don’t need the edges to have integer value lengths any more - just integer length face diagonals and vertices on integer x,y, and z values.

Maybe other way to do it is to stack Pythagorean quadruples on/through each other so that their corners coincide?

Corners at [0 0 0], [2 3 6], [38 21 18] seems to work. That has side lengths of 7, 47, and 42.

Or, simpler: [0 0 0], [2 -3 6], [16 2 8] (side lengths 7, 18, and 15).

Smaller yet: [0 0 0], [2 -1 -2], [14 5 2] (side lengths 3, 15, 14).

Dr. Strangelove - fanstastic, thanks! It looks like stacks of Pythagorean quadruples can work. Was there a particular method you followed to find those, or was it trial and error?

(0,0,0), (3,6,6), and (8,4,-8) works too, for sides 9,12,15.

I thought I had a method, but it doesn’t always work, and I don’t understand it:
Take a Pythagorean quadruple A,B,C,D (2,3,6,7 for example)
Take a Pythagorean triple e,f,g (3,4,5 for example)

Try (0,0,0), (Ae,Be,Ce), (Cf,Af,-Bf)

Thus for quadruple 1,2,2,3 and triple 3,4,5: (0,0,0) (3,6,6) (8,4,-8) works
so does 1,2,2,3 and 5,12,13 : (0,0,0) (5,10,10) (24,12,-24)
Or for quadruple 2,3,6,7 and triple 3,4,5: (0,0,0) (6,9,18) (24,8,-12) works
Quadruple 2,3,6,7 and triple 5,12,13: (0,0,0) (10,15,30) (72,24,-36) works

But it doesn’t work for quadruple 1,4,8,9 or quadruple 4,4,7,9. Weird? Or am I not getting something?

After some more attempts, it seemed like it works when the quadruple is in the form A,B,C,D where C=AB. So it works for [1,2,2,3] and [2,3,6,7] and [3,4,12,13] and [4,5,20,21].

But it doesn’t work for [1,12,12,17]. So I still don’t know what’s going on.

I have a method, fairly complicated that will generate an arbitrary number of them. I started with a Pythagorean right triangle, say with vertices v_1=(0,0,0), v_2=(4,0,0) and v_3=(0,3,0) and then rotated it using the unit quaternion (i+2j+2k)/3. There was no reason for that one, but I wanted one to force the result not to have any special character, so no two coordinates equal. The result, after multiplying by 9 was (0,0,0),\ (-28,16,16),(12,-3,24) with side lengths 36, 27, and 45. This can be varied either by choosing a different unit quaternion or a different Pythagorean triple.

Incidentally, the area is also an integer, in this case 486 = 6*81, 6 being the area of the original triangle and the 81 coming from the multiplication of the lengths by 9. This will always happen since the area of a Pythagorean trinagle is always an integer.

Ugh, quaternions. I never did get the hang of those. I’ll take your word for there being a rotation about some vector, but where does the multiplication by 9 come from in your example? I’ll go review rotations with quaternions now.

I interpret this recipe as just saying, take a triangle with all 3 vertices and sides rational. If you apply a random rational rotation, then it still has the same property, and you can clear denominators after you are done and get integer coordinates. For example, I started with a triangle of side lengths 5, 29, 30; after rotation and re-scaling I got A = (0,0,0), B = (-745, -5068, 2324), C = (-26250, 3000, 21000). The rotation was

\begin{pmatrix} -7/9 & 4/45 & 28/45 \\ 4/45 & -217/225 & 56/225 \\ 28/45 & 56/225 & 167/225 \end{pmatrix}

A short, buggy, Perl script. So, trial and error I guess :slight_smile: . My first iterations on the script didn’t really handle negative coordinates; hence the improved results later. I think my first example is still the smallest where all three sides (considering them as vectors) point to the +++ octant.

You can of course generate many variations by translation, rotation by 90 degrees, mirroring, and scaling. I don’t have any means of generating fundamentally new varieties, though. The rational rotation technique seems pretty good.

I don’t fully understand the question, but I love that there’s a robust discussion of such things here. The only semi-useful thing I can contribute is to mention that using “a” in front of Euler suggests that you don’t know how it is pronounced. The correct pronunciation is “OY-ler.” So, it’s an Euler brick. Please pardon the interruption of the geometry talk.

I multiplied by 9 to convert from a triangle with rational side lengths to integer side lengths. And the rotation was chosen more or less at random. If q is a unit pure quaternion (absolute value 1, no real term) and (x,y,z) is a coordinate which you denote by the quaternion u=xi+yj+zk, then the rotation by q takes u to q^{-1}uq which, confusingly, is called conjugation by q.

I assume your matrix was orthogonal. How did you find it? I gave up on finding rational orthogonal matrices since the Gram-Schmidt process introduces irrationalities; that’s why I used rational unit quaternions, which are easy to find.

Let x^2+y^2+z^2=1 and write the matrix corresponding to u \mapsto quq^{-1} where q = xi+yj+zk with respect to the basis i, j, k. This gives

\begin{pmatrix} x^2-y^2-z^2 & 2xy & 2xz \\ 2xy & y^2 - x^2 - z^2 & 2yz \\ 2xz & 2yz & z^2 - x^2 - y^2 \\ \end{pmatrix}

I put (x,y,z) = (1/3, 2/15, 14/15)

I looked closely at what was going on here and, after some simplification, got that the third side was the square of D^2g^2-2ef(AC+AB-BC) so the method will work whenever A(C+B)=CB which can be rewritten as 1/B+1/C=1/A. Since 1/2+1/2=1/1, 1/6+1/6=1/3, and 1/4-1/8=1/8, this explains all your examples, both the ones that work and the ones that don’t. Once you have found your quadruple satisfying this additional criterion, it will work in conjunction with any Pythagorean triple.