divisionRatioBySegment method
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
double divisionRatioBySegment(Segment segment1, Segment segment2) {
final _divisionRatioBySegmentFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
Float Function(SegmentNative, SegmentNative),
double Function(SegmentNative, SegmentNative)
>('navigine_sdk_flutter_GeometryUtils_divisionRatioBySegment__Segment1_Segment2'));
final __resultHandle = _divisionRatioBySegmentFfi(SegmentImpl.toNative(segment1), SegmentImpl.toNative(segment2));
final _result = __resultHandle;
return _result;
}