# midpoint

Takes two points and returns a point midway between them. The midpoint is calculated geodesically, meaning the curvature of the earth is taken into account.
取两个点,返回两者之间的一个点。中点是测地线计算的,这意味着地球的 曲率 被考虑在内。

参数

参数 类型 描述
point1 Coord first point
point2 Coord second point

返回

Feature <Point> - a point midway between pt1 and pt2

示例

var point1 = turf.point([144.834823, -37.771257]);
var point2 = turf.point([145.14244, -37.830937]);

var midpoint = turf.midpoint(point1, point2);
Last Updated: 1/19/2021, 10:59:20 AM