getCoordinatesAtPercent static method

Coordinates getCoordinatesAtPercent(
  1. List<Coordinates> coords,
  2. double percent
)

Get a coordinate along the path given by a fraction of the path length between 0.0 (departure point) and 1.0 (destination).

Parameters

  • IN coords The path coordinates list.
  • IN percent The size percent (fraction) in the range {0, 1}, e.g. 0.5 will return the coordinates of the point in the middle of the path.

Returns

  • The coordinates at the given percent

Throws

  • An exception if it fails.

Implementation

static Coordinates getCoordinatesAtPercent(
  final List<Coordinates> coords,
  final double percent,
) {
  final OperationResult resultString = objectMethod(
    0,
    'Path',
    'getCoordinatesAtPercent',
    args: <String, Object>{'coords': coords, 'percent': percent},
  );

  return Coordinates.fromJson(resultString['result']);
}