Coordinates given, find whether a point is inside or outside

glid02
Messages
54
Reaction score
0
I'm supposed to derive an equation that will find whether or not a point is inside or outside a shape with only the coordinates of the vertices given.

The shape is expected to be something like this:

______
|...|..._____
|...|______|...|
|......|_____
|........|
|........|
|...___________...|
|...|....|...|
|______|.....|_____|

with the coordinates of the corners given. The shape isn't exactly that but it's basically a collection of boxes.

I really have no idea where to start, if anyone could give me a starting point I'd appreciate it.

Thanks.
 
Physics news on Phys.org
Write one variable as a function of the other. So y = x^2, or whatever.
 
KoGs is right, you do need a function. I would recommend starting with a distance formula, and creating a convention (+ inside object, - outside object). The real problem is that you'll need to subdivide your object into smaller, reasonable pieces. Create perimeter bounds for each of these shapes, and then do the necessary distance calculations. At the end, you will have to compare to make sure you don't have any overlap in your data set -> Sum Individual Data Sets - Union of Data Sets
Another way to tackle this is scan whole object into a matrix, fill the shape, tag inside to be 1's, and then outside to be 0's (null/void). Then apply a particle analysis to see if your point lands on empty or full space in your matrix.
 
Prove $$\int\limits_0^{\sqrt2/4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx = \frac{\pi^2}{8}.$$ Let $$I = \int\limits_0^{\sqrt 2 / 4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx. \tag{1}$$ The representation integral of ##\arcsin## is $$\arcsin u = \int\limits_{0}^{1} \frac{\mathrm dt}{\sqrt{1-t^2}}, \qquad 0 \leqslant u \leqslant 1.$$ Plugging identity above into ##(1)## with ##u...
Back
Top