geometry - Ship movement algorithm -


let's have rectangular sea. it's quite large - 10000x20000.

we have islands, well. simplicity's sake, let's assume rectangular well. know exact places (coordinates).

if have ship, somewhere on map - (x1, y1), how can find shortest path point on map (x2, y2) without going on of islands?

update: there no constraints far - ship or sea. if can simplify (and speed up) things adding few - more welcome.

the path doesn't have best - can 10% off example - acceptable.

  1. aproximate islands' borders 2d poligons
  2. connect vertexes of separated poligons (and start , finish points) edges (they must not cross islands)
  3. apply a* resulting graph

such graph less 10000x20000 grid , let find more realistic paths in better time

update: if islands not big can move ship in direction of finish point , bypass islands on left or right border


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -