Project 15: Finding Axes Length from Ellipse Equation

Intro Problem:  The diagram of the west wing of the White House is shown below.   Using a grid of this wing (where the center of the area is at (0,0)), the equation of the Oval Office is: 

What is the length of the major and minor axis for the Oval Office?  This tells us how long and wide the Oval Office is.

Answer: The minor axis (horizontal length) is 30 feet.  The major axis (vertical length) is 36 feet.


An explanation for a few other ellipses is provided below:

Example 1:

Example 2:

Project 15: Variables 'h', 'k', 'a', 'b'  have been initialized.  

h is the x-coordinate of the center of the ellipse (1 for both examples)

k is the y-coordinate of the center of the ellipse (-2 for the first example and 1 for the second example)

a is the "horizontal radius" of the ellipse (2 for the first example and 4 for the second example)

b is the "vertical radius" of the ellipse (4 for the first example and 2 for the second example)

Task: Appropriately initialize the values of 'majorAxis' and 'minorAxis'.  These variables represent the length of the major and minor axes.

**If your code works for 5 test cases in a row, you can enter your e-mail address.