# Calculate Area of a triangle from coordinates in a 3d Space

I am trying to use Mathematica to solve a very simple problem buy i don't manage to get the right answer.

The problem is to calculate the minimal area of a triangle where the 3 corners of the triangle is three coordinates in the 3d room. One of the coordinates have a variable "u"

The coordinates is

A = [8.32, 0, 4.583]
B = [0, 8.32, 4.583]
C = [8.32, 8.32, u + 4.583]


I have the following mathematic code to find the minimal area of the triangle but i don't get the right answer.

ClearAll["Global*"]
a = {8.32, 0, 4.583}
b = {0, 8.32, 4.583}
c[u_] := {8.32, 8.32, (u^2) + 4.583}
ab = b - a
ac[k_] := c[k] - a
cr[n_] := Cross[ac[n], ab]
nr[p_] := Norm[cr[p]]/2
NMinimize[nr[p], p]

• Does NMinimize[#.# &[Cross[{8.32, 8.32, u + 4.583} - {0, 8.32, 4.583}, {8.32, 0, 4.583} - {0, 8.32, 4.583}]], u] give the expected result? Jan 2, 2017 at 16:48

The inbuild-function Area is capable of giving out analytic formulas for primitives so you don't have to get the formula right for yourself.

Try:

Area[Triangle[{{a, b, c}, {d, e, f}, {g, h, i}}]]


Output omitted (too long).

So we can do:

a = {8.32, 0, 4.583};
b = {0, 8.32, 4.583};
c = {8.32, 8.32, u^2 + 4.583};
areaForm = Area[Triangle[{a, b, c}]]


1/2 Sqrt[4791.74 + 138.445 u^4]

Which we can minimize analytically:

Minimize[areaForm,u]


{34.6112, {u -> -1.71114*10^-16}}

The solution is subject to your set precision. You could enter exact fractions to get the exact result:

a={832/100,0,4583/1000};
b={0,832/100,4583/1000};
c={832/100,832/100,u^2+4583/1000};
areaForm=Area[Triangle[{a,b,c}]]
Minimize[areaForm,u]


104/625 Sqrt Sqrt[21632 + 625 u^4]

{21632/625,{u->0}}`

It also animates very well: 