kurbo 0.10.4

A 2D curves library
Documentation
1
2
3
4
5
6
7
8
9
10
def vieta(x1, x2, x3, x4, case):
    a = -(x1 + x2 + x3 + x4)
    b = x1 * (x2 + x3) + x2 * (x3 + x4) + x4 * (x1 + x3)
    c = -x1 * x2 * (x3 + x4) - x3 * x4 * (x1 + x2)
    d = x1 * x2 * x3 * x4
    print(f'case {case}: {a.real}, {b.real}, {c.real}, {d.real}')

vieta(1e7, -1e6, 1 + 1j, 1 - 1j, 6)
vieta(-7, -4, -1e6 + 1e5j, -1e6 - 1e5j, 7)
vieta(1e8, 11, 1e3 + 1j, 1e3 - 1j, 8)