public static Vector2D getLineIntersect(Line2D line, Line2D other) {

        float m1 = line.getGradient();
        float m2 = other.getGradient();

        //gradient inf and nan tests
        ////////////////////
        boolean m1NaN = Float.isNaN(m1);
        boolean m1Inf = Float.isInfinite(m1);
        boolean m2NaN = Float.isNaN(m2);
        boolean m2Inf = Float.isInfinite(m2);
        ////////////////////
        if (m1NaN || m1Inf || m2NaN || m2Inf) {
            return getAxisLineIntersect(line, other, m1NaN, m1Inf, m2NaN, m2Inf);
        }

        float x = ((m1 * line.getA().getX()) - (m2 * other.getA().getX()) - line.getA().getY() + other.getA().getY()) / (m1 - m2);
        float y = (line.getGradient() * x) + line.getYOffset();
        return new Vector2D(x, y);

    }