interpolate method

GeoCoordinates interpolate(
  1. GeoCoordinates towardCoords,
  2. double factor
)

Computes the coordinates of the interpolated location along the great circle between the two coordinates.

The interpolation factor is clamped to the range [0.0, 1.0] where 0.0 identifies this GeoCoordinates and 1.0 indicates the other coordinates.

The ratio between the distance to the interpolated coordinates and the distance to the other coordinates is approximately equal to the interpolation factor. When both coordinates have the altitude, then the altitude is interpolated as well; null otherwise.

  • towardCoords Coordinates of the point to which the interpolation is directed.

  • factor The interpolation factor

Returns GeoCoordinates. interpolated coordinates

Implementation

GeoCoordinates interpolate(GeoCoordinates towardCoords, double factor) => $prototype.interpolate(this, towardCoords, factor);