Tag Info

Hot answers tagged

4

dist = UniformDistribution[{{-15, 15}, {-4, 4}}]; avgdist = NExpectation[Norm[{x, y, 12}], {x, y} \[Distributed] dist] (* or NExpectation[EuclideanDistance[{x, y, 0}, {0, 0, 12}], {x, y} \[Distributed] dist] *) (* 14.8171 *) Update: You can also obtain the average distance symbolically using Integrate[Sqrt[c^2 + x^2 + y^2] Boole[-a < x < a ...


4

Perhaps this will help in your general use-cases. Part of the problem comes down to how the tetrahedron region is described. Apparently(?), when the coordinates are approximate reals, the finite element method is invoked. Specifying another method appears to cause the message and the integral not being evaluated. However, if exact coordinates are given, ...


1

DensityPlot[EuclideanDistance[{x, y, 0}, {0, 0, 12}], {x, -15, 15}, {y, -4, 4}, AspectRatio -> Automatic] NIntegrate[EuclideanDistance[{x, y, 0}, {0, 0, 12}], {x, -15, 15}, {y, -4, 4}]/(30 8) (* 14.8171 *) {a, b, c, d, e} = {{0, 0, 12}, {-15, -4, 0}, {-15, 4, 0}, {15, 4, 0}, {15, -4, 0}}; coords = {{b, c, d, e}, {a, b, c}, {a, c, d}, ...



Only top voted, non community-wiki answers of a minimum length are eligible