getProjectionRatio method

double getProjectionRatio(
  1. Segment segment,
  2. Point point
)
override

Calculate the division ratio of a segment by a given point Calculate projection point on a segment segment segment of calculation Segment point point of calculation Point Returns division ratio

Example:

// Calculate projection ratio
double projectionRatio = GeometryUtils.getProjectionRatio(segment1, testPoint);
print("Projection ratio: ${projectionRatio.toStringAsFixed(2)}");

Implementation

double getProjectionRatio(Segment segment, Point point) {
    final _getProjectionRatioFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Double Function(SegmentNative, PointNative),
        double Function(SegmentNative, PointNative)
      >('navigine_sdk_flutter_GeometryUtils_getProjectionRatio__Segment_Point'));
    final __resultHandle = _getProjectionRatioFfi(SegmentImpl.toNative(segment), PointImpl.toNative(point));
    final _result = __resultHandle;
    return _result;
}