Problem 193. Smallest distance between a point and a rectangle
Solution Stats
Problem Comments
-
2 Comments
For the n dimensional case it would be better to say that x and y lie on opposite vertices of the n-hypercuboid such that each edge is parallel to a coordinate axis.
Two points do not define a rectangle. This is especially true in 3D space. A correct answer to this question would be 0 or the point closest to the circle defined by the two points on the diameter, depending on the rectangle you chose to make. (Every rectangle formed from two points defining opposite corners makes a circle, and in 3D, a sphere). I genuinely do not know how you want me to handle the 3D cases.
Solution Comments
Show commentsProblem Recent Solvers169
Suggested Problems
-
Swap the first and last columns
18207 Solvers
-
21893 Solvers
-
Find relatively common elements in matrix rows
1790 Solvers
-
2745 Solvers
-
Find the sum of the elements in the "second" diagonal
1117 Solvers
More from this Author38
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!