I must be misunderstanding things but RegionBoundary isn't doing what I naively expect it to do.
In the following code I find the points of an integer lattice that fall within an ImplicitRegion of a quarter circle and the coordinate axes.
ddp[equation_, bnd_] :=
Module[{eqn = equation, bound = bnd, \[ScriptCapitalR], lattice, pts,
pts2, pts3, number},
\[ScriptCapitalR] =
ImplicitRegion[
eqn && 0 < x <= bound + 1 && 0 < y <= bound + 1, {x, y}];
lattice =
Tuples@Replace[
CoordinateBounds[\[ScriptCapitalR]], {p_, q_} :>
Range[Floor[p], Ceiling[q]], {1}];
pts = Point@Select[lattice, RegionMember[\[ScriptCapitalR]]];
pts2 = Point@Select[lattice, #[[1]]^2 + #[[2]]^2 == 100 &];
pts3 =
Point@Select[lattice,
RegionMember[RegionBoundary[\[ScriptCapitalR]]]];
Print[pts2];
Print[pts3];
number = RegionMeasure[pts];
{number,
Show[RegionPlot[\[ScriptCapitalR], PlotPoints -> 2,
MaxRecursion -> 1], Graphics[{Red, PointSize[.015], pts}],
Graphics[{Black, PointSize[.03], pts2}], Frame -> True]}
]
The defined function is called by
lim = 100;
res = ddp[x^2 + y^2 <= lim, lim];
res[[1]]
res[[2]]
(* Point[{{0,10},{6,8},{8,6},{10,0}}] *)
(* Point[{}] *)
(* 69 *)
(* Graphic displayed (but I do not know how to show that on here) *)
Now finding the lattice points in the defined region works (pts in the function). But it will not find the lattice points that lie on the region boundary alone (pts3 in the function). Obviously I can find the lattice points on the boundary using the explicit formula in the pts2 calculation.
My question is: Why doesn't using RegionMember on the RegionBoundary find these points that lie on the boundary? And is there a way of using RegionBoundary for this?
Point[{{0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{9,0},{10,0}}]
$\endgroup$