divisionRatioBySegment static method

double divisionRatioBySegment(
  1. Segment segment1,
  2. Segment segment2
)

Calculate the division ratio of a segment by a given segment(if intersects) segment1 first segment of calculation Segment segment2 second segment of calculation Segment Returns division ratio

Example:

// Calculate division ratio
double divisionRatio = GeometryUtils.divisionRatioBySegment(segment1, segment2);
print("Division ratio: ${divisionRatio.toStringAsFixed(2)}");

Implementation

static double divisionRatioBySegment(Segment segment1, Segment segment2) => $prototype.divisionRatioBySegment(segment1, segment2);