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
-
Reverse the Words (not letters) of a String
450 Solvers
-
Back to basics 11 - Max Integer
791 Solvers
-
Rosenbrock's Banana Function and its derivatives
157 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
1211 Solvers
-
the average value of the elements
1767 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!