The text in the explanation has been color coded to match the app. An unfortunate consequence of this is its limited contrast making it difficult to see on some devices. This app is in no way required as part of our curriculum.
If we didn't understand the Pythagorean Theroem, programmers would be stuck using rectangular boxes to check for collision on round objects.
First, we determine the lengths of A and B utilizing their x and y endpoint coordinates. Next, using the lengths of A and B, we calculate C by employing the Pythagorean Theorem:
A squared + B squared = C squared
Finally, we compare the length of C with the radius of the circle. If C is less than the radius, the mouse is over the circle. If C is greater than the radius, the mouse is outside of the circle.
*The numbers representing A, B, and C are rounded to the nearest whole number for logisitical purposes.