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
-
348 Solvers
-
271 Solvers
-
11737 Solvers
-
Find the Kronecker Tensor Product without using KRON
46 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
1888 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!