← Back to challenges

Rectangle in Circle

JavaScriptHardmathvalidationgeometry

Instructions

Create a function that takes three numbers — the width and height of a rectangle, and the radius of a circle — and returns true if the rectangle can fit inside the circle, false if it can't.

Examples

rectangleInCircle(8, 6, 5) ➞ true

rectangleInCircle(5, 9, 5) ➞ false

rectangleInCircle(4, 7, 4) ➞ false

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Halve and Halve Again