{"id":22992,"date":"2021-09-29T20:13:52","date_gmt":"2021-09-29T14:43:52","guid":{"rendered":"https:\/\/python-programs.com\/?p=22992"},"modified":"2021-11-22T18:35:36","modified_gmt":"2021-11-22T13:05:36","slug":"python-program-to-check-if-a-given-circle-lies-completely-inside-the-ring-formed-by-two-concentric-circles","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-check-if-a-given-circle-lies-completely-inside-the-ring-formed-by-two-concentric-circles\/","title":{"rendered":"Python Program to Check if a given Circle lies Completely Inside the Ring formed by Two Concentric Circles"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Check If a Line Touches or Intersects a Circle<\/a>
\nGiven two circles of radius r and R, their centers are both at the origin. Given another circle with radius r1 and center at (x1, y1). Check to see if the third circle (circle of radius r1) is entirely contained within the ring formed by two circles of radius r and R<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given r = 8\r\nGiven R = 4\r\nGiven r1 = 2\r\nGiven x1 = 6\r\nGiven y1 = 0<\/pre>\n

Output:<\/strong><\/p>\n

The given circle lies inside the ring<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given r = 7\r\nGiven R = 10\r\nGiven r1 = 5\r\nGiven x1 = 2\r\nGiven y1 = 6<\/pre>\n

Output:<\/strong><\/p>\n

The given circle does not lies inside the ring<\/pre>\n

Program to Check if a given Circle lies Completely Inside the Ring formed by Two Concentric Circles<\/h2>\n

Below are the ways to check if the given circle is enclosed completely inside the ring formed by the given two circles in Python:<\/p>\n