# 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 | 第一个点 |
point2 | Coord | 第二个点 |
返回
Feature <Point> - 在 pt1 和 pt2 之间的中点
示例
var point1 = turf.point([144.834823, -37.771257]);
var point2 = turf.point([145.14244, -37.830937]);
var midpoint = turf.midpoint(point1, point2);
← 计算多段线长度 计算位于多边形表面的点 →