docs: public boolean intersect(double tolerance, boolean b_intersecting) {
  		if (m_input_segments.size() != 2)
  			throw GeometryException.GeometryInternalError();
  
  		m_tolerance = tolerance;
  		double small_tolerance_sqr = MathUtils.sqr(tolerance * 0.01);
  		boolean bigmove = false;
  		
  		IntersectionPart part1 = m_input_segments.get(0);
  		IntersectionPart part2 = m_input_segments.get(1);
  		if (b_intersecting
  				|| (part1.seg._isIntersecting(part2.seg, tolerance, true) & 5) != 0) {
  			if (part1.seg.getType().value() == Geometry.GeometryType.Line) {
  				Line line_1 = (Line) part1.seg;
  				if (part2.seg.getType().value() == Geometry.GeometryType.Line) {
  					Line line_2 = (Line) part2.seg;
  					int count = Line._intersectLineLine(line_1, line_2, null,
  							m_param_1, m_param_2, tolerance);
  					if (count == 0) {
  						assert (count > 0);
  						throw GeometryException.GeometryInternalError();
  					}
  					Point2D[] points = new Point2D[9];
  					for (int i = 0; i < count; i++) {
  						// For each point of intersection, we calculate a
  						// weighted point
  						// based on the ranks and weights of the endpoints and
  						// the interior.
  						double t1 = m_param_1[i];
  						double t2 = m_param_2[i];
  						int rank1 = part1.rank_interior;
  						double weight1 = 1.0;
  
  						if (t1 == 0) {
  							rank1 = part1.rank_start;
  							weight1 = part1.weight_start;
  						} else if (t1 == 1.0) {
  							rank1 = part1.rank_end;
  							weight1 = part1.weight_end;
  						}
  
  						int rank2 = part2.rank_interior;
  						double weight2 = 1.0;
  						if (t2 == 0) {
  							rank2 = part2.rank_start;
  							weight2 = part2.weight_start;
  						} else if (t2 == 1.0) {
  							rank2 = part2.rank_end;
  							weight2 = part2.weight_end;
  						}
  
  						double ptWeight;
  
  						Point2D pt = new Point2D();
  						if (rank1 == rank2) {// for equal ranks use weighted sum
  							Point2D pt_1 = new Point2D();
  							line_1.getCoord2D(t1, pt_1);
  							Point2D pt_2 = new Point2D();
  							line_2.getCoord2D(t2, pt_2);
  							ptWeight = weight1 + weight2;
  							double t = weight2 / ptWeight;
  							MathUtils.lerp(pt_1, pt_2, t, pt);
  							if (Point2D.sqrDistance(pt, pt_1)
  									+ Point2D.sqrDistance(pt, pt_2) > small_tolerance_sqr)
  								bigmove = true;
  							
  						} else {// for non-equal ranks, the higher rank wins
  							if (rank1 > rank2) {
  								line_1.getCoord2D(t1, pt);
  								ptWeight = weight1;
  								Point2D pt_2 = new Point2D();
  								line_2.getCoord2D(t2, pt_2);
  								if (Point2D.sqrDistance(pt, pt_2) > small_tolerance_sqr)
  									bigmove = true;
  							} else {
  								line_2.getCoord2D(t2, pt);
  								ptWeight = weight2;
  								Point2D pt_1 = new Point2D();
  								line_1.getCoord2D(t1, pt_1);
  								if (Point2D.sqrDistance(pt, pt_1) > small_tolerance_sqr)
  									bigmove = true;
  							}
  						}
  						points[i] = pt;
  					}
  
  					// Split the line_1, making sure the endpoints are adusted
  					// to the weighted
  					double t0 = 0;
  					int i0 = -1;
  					for (int i = 0; i <= count; i++) {
  						double t = i < count ? m_param_1[i] : 1.0;
  						if (t != t0) {
  							SegmentBuffer seg_buffer = newSegmentBuffer_();
  							line_1.cut(t0, t, seg_buffer);
  							if (i0 != -1)
  								seg_buffer.get().setStartXY(points[i0]);
  							if (i != count)
  								seg_buffer.get().setEndXY(points[i]);
  
  							t0 = t;
  							m_result_segments_1
  									.add(newIntersectionPart_(seg_buffer.get()));
  						}
  						i0 = i;
  					}
  
  					int[] indices = new int[9];
  					for (int i = 0; i < count; i++)
  						indices[i] = i;
  
  					if (count > 1) {
  						if (m_param_2[0] > m_param_2[1]) {
  							double t = m_param_2[0];
  							m_param_2[0] = m_param_2[1];
  							m_param_2[1] = t;
  							int i = indices[0];
  							indices[0] = indices[1];
  							indices[1] = i;
  						}
  					}
  
  					// Split the line_2
  					t0 = 0;
  					i0 = -1;
  					for (int i = 0; i <= count; i++) {
  						double t = i < count ? m_param_2[i] : 1.0;
  						if (t != t0) {
  							SegmentBuffer seg_buffer = newSegmentBuffer_();
  							line_2.cut(t0, t, seg_buffer);
  							if (i0 != -1) {
  								int ind = indices[i0];
  								seg_buffer.get().setStartXY(points[ind]);
  							}
  							if (i != count) {
  								int ind = indices[i];
  								seg_buffer.get().setEndXY(points[ind]);
  							}
  
  							t0 = t;
  							m_result_segments_2
  									.add(newIntersectionPart_(seg_buffer.get()));
  						}
  						i0 = i;
  					}
  
  					return bigmove;
  				}
  
  				throw GeometryException.GeometryInternalError();
  			}
  
  			throw GeometryException.GeometryInternalError();
  		}
  		
  		return false;
  	}