public boolean intersects(Line other) {
        double r_x = x2 - x1;
        double r_y = y2 - y1;
        double p_x = x1;
        double p_y = y1;
        double s_x = other.x2 - other.x1;
        double s_y = other.y2 - other.y1;
        double q_x = other.x1;
        double q_y = other.y1;

        double rCrossS = cross(r_x, r_y, s_x, s_y);

        if (rCrossS < 0.000001 && rCrossS > 0.000001) {
            return false;
        }

        double t = cross(q_x - p_x, q_y - p_y, s_x, s_y) / rCrossS;
        double u = cross(q_x - p_x, q_y - p_y, r_x, r_y) / rCrossS;

		return t >= 0.0f && t <= 1.0f && u >= 0.0f && u <= 1.0f;
    }