## Challenge¶

Create an image of a circle like this one, from scratch, using NumPy. Then plot it with Matplotlib.

The image should be a raster image, 1000 pixels wide by 1000 pixels tall. The circle is purple above and pink below.

## Solution¶

Imagine the raster grid lying in a Cartesian-like coordinate system.

*like*coordinate system.

Now recall the general equation for a circle...

$(x−h)_{2}+(y−k)_{2}=r_{2}$where $(h,k)$ represents the circle's center and $r$ represents its radius.

In this case, we want the radius to be 500 and we want the center at (499.5, 499.5). And since we want to activate points *inside* the circle, we want to use the **inequality**

Once we identify and activate pixels in the circle interior, we can easily make the upper half purple and the lower half pink.