Destination Rotation Single
Destination Rotation Single
![]() |

How do you compute the shortest path on a plane with convex obstacles?
I've managed to create an algorithm to compute the shortest path between two points on a 2D plane when there is a single convex polygon acting as an obstacle (path may not pass through it). However, how would one go about doing the same thing when there are multiple obstacles involved?
The method I've used for finding a route with just one obstacle involves sorting all points on the plane (including the destination point - B) in order of clockwise rotation about the starting point (A), and connecting them in that order. I can then traverse the list of points in order, calculating the distance between A and B in one direction, and then the distance between B and A (continuing along the same path), and by choosing the shortest of the two, I have the shortest route.
This method doesn't work for two or more obstacles though, or if it does, I'm not sure how to deal with it. Any ideas?
When you have a network of nodes and arcs (directed or otherwise), there are standard algorithms for computing the shortest path between any pair of nodes.
One possible approach could be to create a network on the fly, after you know the coordinates of the starting point (=node A) and ending point (=node B). Create extra nodes, one for each corner of each convex polygon. Creating feasible arcs (that don't go within any of the polygons) would be the tough part. Each node i on a particular polygon has only its two immediate neighbors as feasible nodes which can be reached by a single arc; all other corners of its polygon are unreachable by a single arc. You will now need to figure out a method to compute whether the arc between every node pair (i,j) is feasible, when i and j belong to different polygons; also when one of the nodes i/j is a polygon node, and the other is a start/destination node.
If you are able to do this, you would have a network of nodes and feasible straight-line-travel arcs, and you could use one of the standard shortest-path algorithms; for example, see
http://renaud.waldura.com/doc/java/dijkstra/
![]() Pioneer SPH-DA01 AppRadio 6.1-Inch In-Dash Double-Din AV Receiver for iPod and iPhone List Price: Sale Price: $279.89 You save: $170.11 (38%) Eligible for free shipping!Availability: Usually ships in 1-2 business days |



US $265.00






Eligible for free shipping!