Problem 60301. Compute the area of a lune
Write a function to compute the area of the shaded moon-shaped region in the figure below—that is, the area of a smaller circle that does not overlap with a larger circle. The input will be the radius a of the smaller circle, the radius b of the larger circle, and the separation c between centers of the circles.
Solution Stats
Problem Comments
-
2 Comments
Tim
on 28 May 2024
When c is close to b-a (as in test case 4, with a=3, b=4, c=1.01) the solutions are susceptible to roundoff error; after some checking, I believe the correct answer for test case 4 (to 15 significant figures) should be A=0.00650196332827386 rather than A=0.006501963328256.
ChrisR
on 1 Jun 2024
I changed the tolerance on that test.
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
-
Back to basics 20 - singleton dimensions
271 Solvers
-
Remove the two elements next to NaN value
676 Solvers
-
Remove entire row and column in the matrix containing the input values
452 Solvers
-
Create an array (n,n) where only diagonal elements are '1' and others are '0'
85 Solvers
-
Create cell array of numeric arrays
43 Solvers
More from this Author312
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!