Physics Forums (http://www.physicsforums.com/index.php)
-   General Math (http://www.physicsforums.com/forumdisplay.php?f=73)
-   -   Plotting the naval territory of a country (http://www.physicsforums.com/showthread.php?t=252579)

 jbunten Aug29-08 07:53 PM

Plotting the naval territory of a country

OK, say we have the border of a country represented by a polygon, how do we obtain a new border which at every point has it's nearest point to the country at exactly say 10 miles from it?

Is there an algorithm to do this or is it highly computational?

It's not as simple as it first seems.

 mgb_phys Aug29-08 08:08 PM

Re: Plotting the naval territory of a country

If you have an equation for each straight line segment, you could generate a parallel line 10miles from it (have to get the sign right for =outside).
Then find the intersect fro each line segment with the next to cut them into a single polygon.
Might not be the most efficent and for a true 10mile limt you would have to round the corners where the line segments meet to a 10mi radius.

There is probably a well known aglorithm for this - try http://www.cgal.org/

 jbunten Aug29-08 08:18 PM

Re: Plotting the naval territory of a country

That's what I thought, but the problem is far more complex, imagine a bay that goes very far inland (20mi for instance) then 10mi from that bay can be very near to another part of the island, the problem is deceptively complex.

 mgb_phys Aug29-08 08:43 PM

Re: Plotting the naval territory of a country

Yes, it is tricky.
In image processing it's known as dilation, you use it to close up any gaps in an image and then erode back to the original size before doing operations like character recognition. If you have the map as a bitmap you can probably find an image library thatworks well (eg opencv?)

 jbunten Aug30-08 05:07 AM

Re: Plotting the naval territory of a country

Hi, fraid not, they would have to exist as a set of coordinates.

 All times are GMT -5. The time now is 09:43 PM.