Perimeter and area are positive integers

In Geometry 3D, How can I create a triangle whose perimeter and area are positive integers with Mathematica?

I found three triangles. For example $A(-6,1,2)$, $B(-9,1,2)$, $C(-9,1,6)$ or $A(-2,-1,4)$, $B(-2,2,4)$, $C(-2,2,8)$ or $A(-1,-1,-2)$, $B(-1,-1,1)$, $C(-5,-1,1)$.

And some another triangles: $A(-8,-9,-3)$, $B(4,-9,6)$, $C(-8,-9,1)$ or $A(0,3,3)$, $B(9,-9,3)$, $C(4,3,3)$ or $A(-7,5,7)$, $B(2,5,-5)$, $C(-3,5,7)$. Dear belisarius, I am sorry about that.

-
Perhaps, a right triangle whose side lengths form a Pythagorean triple? Now, what that has to do with Mathematica or Geometry 3D (whatever that is), I don't know. Do you want to plot such a thing? – Mark McClure Sep 15 '12 at 3:00
So, a Heronian triangle? – J. M. Sep 15 '12 at 3:02
Dear minthao_2011: You already asked five question here, and those received good answers. But you accepted none, and never voted a question nor an answer. Please read the FAQs. Voting and accepting are important. If you don't do that. your questions will probably receive less attention and answers in the future – belisarius Sep 15 '12 at 4:23
Clearly minthao here has a different concept of "positive" from the rest of us... – J. M. Sep 15 '12 at 10:24
I want to find the coordinates of the vertices $A$, $B$ and $C$. – minthao_2011 Sep 15 '12 at 14:37

If we interpret the question to be a search for triangles with integer-valued perimeter and integer-valued area, then we can approach the problem by asking that a,b,c be the lengths of the sides with a+b+c=integer. The area needs to be calculated in terms of a,b,c. This can be done by solving the three equations:

c^2 = h^2 + b1^2;
a^2 = h^2 + b2^2;
b= b1 + b2;


Here h is the height of the triangle and the top two equations come from the pythagorean theorem. In Mathematica, we solve

Solve[{c^2 == h^2 + b1^2, a^2 == h^2 + b2^2, b == b1 + b2},
{h, b1, b2}]


which gives two answers. One of the answers has h negative and one has h positive, so we can throw away the negative answer and find:

 h -> Sqrt[-a^4 + 2 a^2 b^2 - b^4 + 2 a^2 c^2 + 2 b^2 c^2 - c^4]/(2 b),
b1 -> (-a^2 + b^2 + c^2)/(2 b),
b2 -> (a^2 + b^2 - c^2)/(2 b)}


The area is now 1/2 (b1+b2) h. Substituting these values in and simplifying gives

 area = 1/4 Sqrt[-(a - b - c) (a + b - c) (a - b + c) (a + b + c)]


We can now check to verify that the area is integer. Take for instance a right (3,4,5) triangle:

 area //. {a -> 3, b -> 4, c -> 5}


which has area 6.

-