Problem 46565. Find an inscribed square on a closed curve
Solution Stats
Problem Comments
-
5 Comments
Where is the square in the last test? The test passes with [1 3 5 7], but that's a rhombus. The angle test works because the dot products are 3, 3, -3, -3, and their sum is still zero. Perhaps checking that all dot products are zero (or less than a tolerance) would work.
Hello Chris, there is actually a typo from my side in the last test case.
Point #6 is supposed to be (1,-1) instead of (-1, 1) (which occurs twice).
I am unable to correct the test suite at this moment, I will update it inline with your feedback, as soon as I can.
Hello Chris, I have corrected the test case #7 and modified the test suite as per your suggestion.
Also, I have rescored the solutions.
It was interesting to see that quite a many solutions failed the last test case, incorrectly giving the rhombus as the solution
(i.e [1 3 5 7]).
Solution Comments
Show commentsProblem Recent Solvers6
Suggested Problems
-
1792 Solvers
-
2966 Solvers
-
Convert a numerical matrix into a cell array of strings
2065 Solvers
-
Back to basics 22 - Rotate a matrix
910 Solvers
-
4498 Solvers
More from this Author50
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!