Is there any algorithm for finding a shape from a point? -


is there algorithm finding shape point? consider if have list of polygon, got 2 shape:

shape 1: x , y

[10,10,] [10,40,] [40,10,] [40,40,] 

shape 2: x , y

[40,40,] [40,80,] [80,40,] [120,120,] 

if have point lets point 1 x , y

[119,199] 

that means choose shape 2, there algorithm determine shape point?

there many different data structures performing kind of query - tree structures represent polygons in spatial hierarchy of sort. personal favourite r-tree, has very implementation in recent versions of boost libraries. build r-tree list of polygons , it's simple (and efficient) matter perform query given point see polygon(s) lies within.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -