Problem 2242. Wayfinding 5 - Travel contour
This is the fifth part of a series of assignments about wayfinding. The final goal of this series is to be able to calculate the fastest route through a terrain of areas with different properties. The assignments will build on top of each other, gradually increasing the complexity, but guiding you stepwise towards the final goal. You can re-use code from preceding assignments to save some work. See search:tag=wayfinding for the other assignments.
This time, you will travel around a polygon, over its contour. You get the nodes of the polygon, in the correct order, as a 2xn array F. The last node of F is connected to the first node.
a is the index in F of the starting node, and b is the goal.
Calculate the shortest distance from a to b over the contour of the polygon.
The distance is measured as the Euclidean distance between points. You can not enter the internal area of the polygon. The contour of the polygon does not self-intersect.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
Find relatively common elements in matrix rows
2051 Solvers
-
157 Solvers
-
684 Solvers
-
How many trades represent all the profit?
599 Solvers
-
USC Fall 2012 ACM : Code Word Minimum Flipped Bits
19 Solvers
More from this Author31
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!