package math.polynomials;

import math.utils.ArrayUtil;
import math.utils.Util;

public class Poly15 {
    public static void main(String[] args) {
        Jdm jdm1 = new Jdm(4, "x", 3);
        Jdm jdm2 = new Jdm(-3, "x", 2);
        Jdm jdm3 = new Jdm(2, "x", 1);
        Jdm jdm4 = new Jdm(-1, "x", 0);
        Jdm[] arr1 = {jdm1, jdm2, jdm3, jdm4};
        Poly poly1 = new Poly(arr1);
        Util.print(poly1);
        Jdm jdm5 = new Jdm(1, "x", 1);
        Jdm jdm6 = new Jdm(-2, "x", 0);
        Jdm[] arr2 = {jdm5, jdm6};
        Poly poly2 = new Poly(arr2);
        Util.print(poly2);
        Poly[] poly = PolyUtil.divHorner(poly1, poly2);
        ArrayUtil.print(poly);
        double[] a = poly1.getCoeffsHorner(2);
        ArrayUtil.print(a);
    }
}
