public Line(Point p1, Point p2) {
            coeff[0] = p2.y - p1.y;
            coeff[1] = p1.x - p2.x;
            coeff[2] = p1.x * p2.y - p2.x * p1.y;
            int d = gcd(gcd(coeff[0], coeff[1]), coeff[2]);
            // make sure the first non-zero number is positive
            if (coeff[0] < 0 || coeff[0] == 0 && coeff[1] < 0
                    || coeff[0] == 0 && coeff[1] == 0 && coeff[2] < 0) {
                d = -d;
            }
            // make sure the gcd is 1 (unless all numbers are 0).
            if (d != 0) {
                coeff[0] /= d;
                coeff[1] /= d;
                coeff[2] /= d;
            }
        }