Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Finding if a point is within a shape.
Author Message
mirhagk

Posted: Tue May 28, 2013 7:37 am   Post subject: Finding if a point is within a shape.

Hello all,

I'm building a system that at one point needs to use GPS coordinates to figure out if a point is within a range of certain objects. Some objects may not have a range however, and may instead have a region that I want to check.

The region can be denoted by the vertices and edges, and I'm trying to determine a fast way to check if it's within the shape made.

Originally I thought about taking a radius for each vertex (which covers the area, and a little more), and make sure it's in all of the radii, but I realized that that'd give an estimate, and it'd be pretty poor in some cases. The shapes can be arbitrary, but they shouldn't be too complex (as in they should only have a few points each, not hundreds, probably max around 10).

Does anyone have any ideas for how I can do this?

Insectoid

Posted: Tue May 28, 2013 7:48 am   Post subject: RE:Finding if a point is within a shape.

http://en.wikipedia.org/wiki/Point_in_polygon
2goto1

Posted: Tue May 28, 2013 8:31 am   Post subject: RE:Finding if a point is within a shape.

Are you looking for a Cartesian solution or a Geographic solution, and what development tools are you using and storing the data within? Are you looking to implement your own algorithms?
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 3 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: