I see this behaviour rather erroneous:
reg = ImplicitRegion[(x - 2)^2 + (y - 3)^2 + (z - 8)^2 == 1, {x, y, z}];
RegionPlot3D[reg]
leads to an empty plot, and
RandomPoint[reg]
RandomPoint[
ImplicitRegion[(-2 + x)^2 + (-3 + y)^2 + (-8 + z)^2 == 1, {x, y, z}]]
On the other hand, a similar construct in 2D works:
reg2 = ImplicitRegion[x^2 + y^2 == 1, {x, y}];
RandomPoint[reg2]
{0.961994, 0.27307}
while
RegionPlot[reg2]
gives an empty plot, too.
The behaviour of RegionPlot3D
is explained in the docs:
RegionPlot3D[pred,....]
The predicate pred can be any logical combination of inequalities.
Moreover:
RegionPlot3D initially evaluates pred at a 3D grid of equally spaced sample points specified by PlotPoints. Then it uses an adaptive algorithm to subdivide at most MaxRecursion times, attempting to find the boundaries of all regions in which pred is True.
The same can be found in the docs of RegionPlot
. Ok, so we shouldn't expect the plots to work.
BUT:
Recall that RandomPoint[reg]
didn't work; consider instead
reg3 = ImplicitRegion[(x - 2)^2 + (y - 3)^2 - (z - 8)^2 == 1, {x, y, z}];
where I only changed the sign before $(z-8)^2$. Then:
RandomPoint[reg3]
{6.81984, 4.05919, 3.16754}
with an error:
RandomPoint::unbndreg: The specified region appears to be unbounded. Appropriate bounds will be automatically computed. Explicit bounds may be specified as a third argument.
which can be easily dealt with by providing the third argument:
RandomPoint[reg3, 1, {{-10, 10}, {-10, 10}, {-10, 10}}]
{{-2.33781, 2.75421, 3.77188}}
Hence, I see no reason why RandomPoint
, working for reg3
, shouldn't work for reg
.
RandomPoint[Sphere[{2, 3, 8}, 1], 500]
$\endgroup$RandomPoint[ImplicitRegion[x^2 + y^2 == 1, {x, y}]]
works, but in 3D it doesn't. Nothing in the documentation (except for a lack of working examples...) indicates it shouldn't work. $\endgroup$