Check if a circle is contained in another circle

前端 未结 4 759
青春惊慌失措
青春惊慌失措 2020-12-15 12:33

I\'m trying to check if a circle is contained within another circle. I\'m not sure if the math behind it is the problem or if its my if statement because I keep getting

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-15 13:16

    You have distance_2 = distance + circle.get_radius(), so distance_2 will always be higher than distance and distance_2 > distance will always be true.

提交回复
热议问题