2
$\begingroup$

If we have two domains, it is possible to check whether one domain is inside another domain:

domain1 = Rectangle[{-2.5, -2.5}, {2.5, 2.5}];
domain2[R_] := Disk[{0, 0}, R]
condition[R_] := Boole @ RegionWithin[domain1, domain2[R]]

Now, let us consider a point

point[x_,y_] = {x,y}

Is it possible to check whether the point belongs to the region using something like RegionWithin (like PointWithin (?))?

$\endgroup$

2 Answers 2

3
$\begingroup$

Try

RegionMember[domain1, {1, 1}]
(*True*)
$\endgroup$
4
$\begingroup$

For a point, we can also use RegionWithin since we can consider the region Disk[{x0,y0},0]

domain1 = Rectangle[{-2.5, -2.5}, {2.5, 2.5}];
RegionWithin[domain1, Disk[{1, 1}, 0]]

True

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.