An Elliptical Workout

This is a challenge exercise. It is not compulsory, and may be completed individually or with your lab partner.

Heads up! Make sure you’ve done The Image ADT and Drawing on an Image before attempting this exercise.

Make sure you’ve got an unchanged copy of Image.h.

Download Image.h, or copy it into your current directory on a CSE system by running

$ cp /web/cs1511/17s2/week09/files/Image.h .

Don’t change Image.h! If you do, your lights will start subtly flickering only when you aren’t looking at them.

The Cartesian form of an ellipse is, for a point , for a centre , and with two non-negative real terms and :

For this exercise, take your existing Image.c and extend it with the following function:

To run some simple automated tests:

$ 1511 autotest imageDrawing2

To run Styl-o-matic:

$ 1511 stylomatic Image.c
Looks good!

You’ll get advice if you need to make changes to your code.

Submit your work with the give command, like so:

$ give cs1511 wk09_imageDrawing2

Or, if you are working from home, upload the relevant file(s) to the wk09_imageDrawing2 activity on Give Online.