Method and maths (maps, geometry, etc.)
Posted: Thu Dec 09, 2010 2:15 pm
Hello all you happy people!
Once again I come here to have you solve all my problems, but hey, at least I'm keeping you all in shape
The problem at hand is this:
I have a flat map, that is , no weird math involving degrees longitude latitude and stuff like that, which is way beyond my abilities. Instead a point is determined by regular linear x/y coordinates, which should make things a bit easier.
I have defined an area on the map, using a simple closed poly line consisting of 3 or more points and now I need to determine if a specific point is placed inside this area. In reality there is talk of thousands of points, which is why this can't be done manually.
I've considered a number of options, none of which are practical and only one of which can work in reality it seems.
The one solution that I've considered and abandoned because it's simply too much work, is to make a sort of a table of ranges, then it should be a simple matter to look up coordinate y and check if coordinate x is within range or not.
As you can imagine, this is not very practical, but more importantly, it will be hard, though not impossible, to get working in reality as some areas has very complex shapes.
I'm thinking that it must be possible to use another approach. In the end, it's all just simple trigonometry, however, while it may be easy for a human being to do this, I'm at a loss as to how I'm going to get a machine to do it.
It should be noted that these areas are not overly complex, and that the number of points defining them may be, at worst, 20 point or similar. Also, I'm using the gmap v3 engine, in case any of you should know of some fancy feature which I've overlooked.
I do hope that one of you have an idea how to approach this problem (and maybe an idea for a better title? ) but knowing that the average IQ on this forum far surpasses my own, and I'm not as stupid as I seem, I'm not too worried.
Sample data (of the top of my head)
area: (1,1), (1,5), (3,3), (5,5), (6,0), (5,1), (5,2)
points: (5,3), (2,1), etc.
Unless you actually draw this, you'll notice that it's not too easy to visualise
Anyway, thanks in advance, I'll be seeing you all soon.
Best regards.
Once again I come here to have you solve all my problems, but hey, at least I'm keeping you all in shape
The problem at hand is this:
I have a flat map, that is , no weird math involving degrees longitude latitude and stuff like that, which is way beyond my abilities. Instead a point is determined by regular linear x/y coordinates, which should make things a bit easier.
I have defined an area on the map, using a simple closed poly line consisting of 3 or more points and now I need to determine if a specific point is placed inside this area. In reality there is talk of thousands of points, which is why this can't be done manually.
I've considered a number of options, none of which are practical and only one of which can work in reality it seems.
The one solution that I've considered and abandoned because it's simply too much work, is to make a sort of a table of ranges, then it should be a simple matter to look up coordinate y and check if coordinate x is within range or not.
As you can imagine, this is not very practical, but more importantly, it will be hard, though not impossible, to get working in reality as some areas has very complex shapes.
I'm thinking that it must be possible to use another approach. In the end, it's all just simple trigonometry, however, while it may be easy for a human being to do this, I'm at a loss as to how I'm going to get a machine to do it.
It should be noted that these areas are not overly complex, and that the number of points defining them may be, at worst, 20 point or similar. Also, I'm using the gmap v3 engine, in case any of you should know of some fancy feature which I've overlooked.
I do hope that one of you have an idea how to approach this problem (and maybe an idea for a better title? ) but knowing that the average IQ on this forum far surpasses my own, and I'm not as stupid as I seem, I'm not too worried.
Sample data (of the top of my head)
area: (1,1), (1,5), (3,3), (5,5), (6,0), (5,1), (5,2)
points: (5,3), (2,1), etc.
Unless you actually draw this, you'll notice that it's not too easy to visualise
Anyway, thanks in advance, I'll be seeing you all soon.
Best regards.