#!/usr/bin/env python3

# Copyright (C) 2021 elphmod Developers
# This program is free software under the terms of the GNU GPLv3 or later.

"""Usage: minimum x1 x2 x3 y1 y2 y3

Returns extremum of parabola through given points.
"""

import sys

if len(sys.argv) == 7:
    x1, x2, x3, y1, y2, y3 = list(map(float, sys.argv[1:]))
else:
    raise SystemExit(__doc__.strip())

enum = x1 ** 2 * (y2 - y3) + x2 ** 2 * (y3 - y1) + x3 ** 2 * (y1 - y2)
deno = x1 *  2 * (y2 - y3) + x2 *  2 * (y3 - y1) + x3 *  2 * (y1 - y2)

if deno:
    print(enum / deno)
else:
    print('There is no extremum.')
