Problem 51. Find the two most distant points
Solution Stats
Problem Comments
-
7 Comments
Show
4 older comments
Jean-Marie Sainthillier
on 19 Jul 2012
More easy that it seems.
Carl Witthoft
on 20 Nov 2015
You need to specify "Euclidean" distance :-)
Jerivington
on 6 Jun 2016
Good problem, not too hard but required thinking
Dima Panna
on 3 Jun 2019
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]
heart
on 8 Feb 2020
refer to
Convex Hull therom and the Graham's Scan method
Can Tekin
on 12 Jun 2020
+1
Peter
on 16 Aug 2023
Nice one!
Solution Comments
Show commentsProblem Recent Solvers2533
Suggested Problems
-
1161 Solvers
-
Project Euler: Problem 9, Pythagorean numbers
995 Solvers
-
Find the largest value in the 3D matrix
1428 Solvers
-
536 Solvers
-
Reverse the elements of an array
969 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!