A dartboard of radius 10 units and the wall it is hanging on are represented using a two-dimensional coordinate system, with the board’s center at coordinate (0,0). Variables x and y store the x-coordinate and the y-coordinate of a dart that hits the dartboard. Write a Python expression using variables x and y that evaluates to True if the dart hits (is within) the dartboard, and then evaluate the expression for these dart coordinates:
True
(10,10)
False
(6, 6)
True
(7,8)
False
Explanation
The dartboard is a circle with center at (0,0) and radius 10 units. For a dart at coordinates (x,y) to be within the dartboard, the distance from the center to the point must be less than or equal to the radius. Using the distance formula, the distance from (0,0) to (x,y) is . For this to be 10, we get x² + y² 100. This is the condition for the dart hitting the dartboard.