← Back to challenges

Find the Vertex of a Quadratic

PythonHardalgebramath

Instructions

Every quadratic curve y = a x² + b x + c has a vertex point: the turning point where the curve stops heading down and starts going up.

Given the values a, b and c, you need to return the coordinates of the vertex. Return your answers rounded to 2 decimal places.

Examples

find_vertex(1, 0, 25)  ➞ [0, 25]
# The vertex of y=x²+25 is at (0, 25).

find_vertex(-1, 0, 25) ➞ [0, 25]
# The vertex of y=-x²+25 is at (0, 25).

find_vertex(1, 10, 4) ➞ [-5, -21]
# The vertex of y=x²+10x+4 is at (-5, -21).

Notes

  • a will always be non-zero.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Sum Fractions