Optional Project 22: Vertices and Co-Vertices of a Hyperbola

Intro Problem: If the waist (middle point) of the hourglass shown below is at the origin (0, 0), the hourglass can be expressed (in cm) as the hyperbola equation:

The vertices of this hourglass would be (0, -10) and (0, 10).  The co-vertices of this hourglass would be (-5, 0) and (5, 0)

Here are a few other examples of hyperbola equations:

Optional Project 22:  Variables 'h', 'k', 'a', 'b', 'vertical' have been initialized.  

h is the x-coordinate of the center (2 in the first example, 5 in the second example)

k is the y-coordinate of the center (1 in the first example, 4 in the second example)

a is the horizontal distance from the center to vertices/co-vertices (4 in the first example, 3 in the second example)

b is the vertical distance from the center to vertices/co-vertices (2 for both examples)

vertical represents whether the hyperbola is vertical (opens up/down as opposed to left/right)

vertical is true for the first example, false for the second example

Task: Appropriately initialize the values of 'vertexX1', 'vertexY1', 'vertexX2', 'vertexY2', 'covertexX1', 'covertexY1', 'covertexX2', 'covertexY2'

Note: For this project, vertex/covertex 1 will always be below (smaller y-coordinate) or to the left (smaller x-coordinate) than the corresponding vertex/covertex 2.

First example: vertexX1 = 2, vertexX2 = 2, vertexY1 = -1 vertexY2 = 3 because vertex 1 is the one below vertex 2.

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

Universal Computational Math Methods:

pow(5,2) returns 25.0

abs(-3.0) returns 3

sqrt(49.0) returns 7.0