Problem 330. Circumscribed circles
Solution Stats
Problem Comments
Solution Comments
-
3 Comments
Either I am going mad or Test 1 is broken... (It's quite possibly the former!) Can anyone help?
It's probably a roundoff error in the calculation of the angle (in degrees) by acosd, which causes the end-result to have a slight offset (in the 7th or 8th decimal, which is not printed on-screen but which is there) from the exact correct answer. So instead, use the identity "(sin(x))^2 + (cos(x))^2 = 1" in order to eliminate the use of sin and cos in your calculation.
Lucinda King, you make a fair point: preferably the Test Suite should have allowed for these "slight offsets" that are created when working with floating-point numbers. Especially when the "correct" answers are not integers. [See e.g. Problem 44690.]
-
1 Comment
Why is 2.5000 not considered equal to 2.5?
Problem Recent Solvers322
Suggested Problems
-
The Goldbach Conjecture, Part 2
1767 Solvers
-
Find the peak 3n+1 sequence value
1577 Solvers
-
Back to basics 17 - white space
253 Solvers
-
318 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
571 Solvers
More from this Author39
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!