Problem 51. Find the two most distant points
Solution Stats
Problem Comments
-
6 Comments
More easy that it seems.
You need to specify "Euclidean" distance :-)
Good problem, not too hard but required thinking
Please add the next test :
p = [0,0;
2,1;
2,6;
1,6];
ix_correct = [1 3];
assert(isequal(mostDistant(p),ix_correct))
The solutions of the form:
[~,indx]=max(dist(p'));
unique(indx)
will fail, the last line will return an extra index [1,3,4] instead of just [1,3]
refer to
Convex Hull therom and the Graham's Scan method
+1
Solution Comments
Show commentsProblem Recent Solvers2494
Suggested Problems
-
5367 Solvers
-
245 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
1434 Solvers
-
3941 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
692 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!