Project 13: Equation of Parabola given Focus and Vertex

Project 13: Variables 'vX', 'vY', 'focusX', 'focusY' have been initialized.

vX is the x-coordinate of the vertex

vY is the y-coordinate of the vertex

focusX represents the x-coordinate of the focus

focusY represents the y-coordinate of the focus

Task: Appropriately initialize the values of 'directrix', 'a', and 'verticalParabola'

directrix represents the value of the directrix (i.e. y = directrix for vertical parabola, x = directrix for horizontal parabola)

a is the leading coefficient of the parabola

verticalParabola represents if the parabola is vertical opens up or down or horizontal opens left or right (true if vertical; false if horizontal)

Here are two examples below:

Given: 

vX = 0

vY = 0

focusX = -4

focusY = 0

The following would be initialized:

p = 4 (not a required variable)

p is the distance between the vertex and the focus, which is the same as the distance between the vertex and the directrix.

a = -1/16 (negative because it opens to the left)

directrix = 4 (which represents x = 4)

verticalParabola = false

Given: 

vX = 0

vY = 0

focusX = 0

focusY = -1.5

The following would be initialized:

p = 1.5 (not a required variable)

a = -1/6 (negative because it opens down)

directrix = 1.5 (which represents y = 1.5)

verticalParabola = true

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