Concentric Circles
Start Timer
0:00:00
We have two concentric circles a and b, each of them having a radius r_a
, r_b
where r_b
> r_a
.
The third circle c has a different radius calculation, with radius r_c
and center point center_c
.
Write a function is_contained(r_a,r_b, r_c, center_c)
which returns True
if the circle c occupies the space between circle a and b. Otherwise, return False
.
Note: the center point of a
and b
is (0,0)
As an example, only c_2
meets the requirement in this image as it lies between a
and b
.
Example 1:
Input:
r_a = 3
r_b = 6
r_c = 1
center_c = (4,0)
Output:
is_contained(r_a,r_b,r_c,center_c) -> True
Example: 2
Input:
r_a = 3
r_b = 6
r_c = 1
center_c = (6,0)
Output:
is_contained(r_a,r_b,r_c,center_c) -> False
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments