TransWikia.com

A condition for the given point to be included in the domain?

Mathematica Asked on July 17, 2021

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 (?))?

2 Answers

Try

RegionMember[domain1, {1, 1}]
(*True*)

Correct answer by Ulrich Neumann on July 17, 2021

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

Answered by cvgmt on July 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP