getProjectionRatio static method

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

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

static double getProjectionRatio(Segment segment, Point point) => $prototype.getProjectionRatio(segment, point);