Coordinates given, find whether a point is inside or outside

Click For Summary
SUMMARY

This discussion focuses on determining whether a point lies inside or outside a polygon defined by its vertex coordinates. Key methods suggested include using a distance formula to establish a convention for inside and outside points and subdividing the shape into smaller components for easier calculations. Additionally, a matrix-based approach is proposed, where the shape is filled and tagged to differentiate between inside and outside areas. The final step involves comparing data sets to ensure no overlaps occur in the calculations.

PREREQUISITES
  • Understanding of coordinate geometry and vertex representation
  • Familiarity with distance formulas in mathematics
  • Basic knowledge of matrix operations and particle analysis
  • Experience with computational geometry concepts
NEXT STEPS
  • Research the implementation of distance formulas in computational geometry
  • Learn about polygon subdivision techniques for complex shapes
  • Explore matrix representation and manipulation for spatial analysis
  • Investigate algorithms for point-in-polygon testing
USEFUL FOR

Mathematicians, computer scientists, and software developers working on geometric algorithms, spatial analysis, or game development involving collision detection.

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.
 

Similar threads

  • · Replies 63 ·
3
Replies
63
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
9
Views
3K
Replies
8
Views
3K
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 3 ·
Replies
3
Views
15K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K