, , , ...
Mathematica. , , 2D . , {0,0} {1,0} {0,1}. , , , {0.0} . , , , , 10. Mathematica
Mean[Table[EuclideanDistance[{0, 0}, {1 - k, 0 + k}], {k, 0, 1, 10.0^-1}]]]
0.830255. , . , , 10.0 ( !). Mathematica:
Table[Mean[Table[EuclideanDistance[{0, 0}, {1 - k, 0 + k}], {k, 0, 1,
10.0^-i}]], {i, 0, 6}]
:
{1, 0.830255, 0.813494, 0.811801, 0.811631, 0.811615, 0.811613}
, @Dave ( ):
Table[Mean[Table[EuclideanDistance[{0, 0}, {4, 0 + 3 k}], {k, 0, 1,
10.0^-i}]], {i, 0, 6}]
:
{9/2, 4.36354, 4.34991, 4.34854, 4.34841, 4.34839, 4.34839}
, @dreeves , @Dave .
EDIT: , . , , , {0,0} {0,1} {1,0}, Mathematica ( ), :
fun2[k_] := EuclideanDistance[{0, 0}, {0 + k, 1 - k}]
. Mathematica :
In[13]:= Integrate[fun2[k], {k, 0, 1}]
Out[13]= 1/4 (2 + Sqrt[2] ArcSinh[1])
, , :
In[14]:= NIntegrate[fun2[k], {k, 0, 1}]
Out[14]= 0.811613
, .
Now I will return to work and leave it to everyone to generalize this to an arbitrary triangle defined by a point and end points of a segment.