计算两个点之间的方位角,采用球模型。
该函数使用 @turf/bearing 库来计算从起点到终点的方位角。方位角的取值范围是 0 到 360 度。
@turf/bearing
起点的三维向量坐标。这个参数代表了起始点的位置信息。
终点的三维向量坐标。此参数表示了目标点的位置信息。
从起点到终点的方位角,取值范围在 0 - 360 度之间。
该函数依赖于 @turf/bearing 和 @turf/helpers 库。@turf/bearing 用于计算方位角, @turf/helpers 中的 point 函数用于将 ESJVector3D 类型的坐标转换为 turf 库所需的点对象。
@turf/helpers
point
ESJVector3D
turf
import { ESJVector3D } from '../../ESJTypes';import { geoHeading } from './geoHeading';const startPoint: ESJVector3D = [0, 0, 0];const endPoint: ESJVector3D = [1, 1, 0];const heading = geoHeading(startPoint, endPoint);console.log(heading); // 输出计算得到的方位角 复制
import { ESJVector3D } from '../../ESJTypes';import { geoHeading } from './geoHeading';const startPoint: ESJVector3D = [0, 0, 0];const endPoint: ESJVector3D = [1, 1, 0];const heading = geoHeading(startPoint, endPoint);console.log(heading); // 输出计算得到的方位角
计算两个点之间的方位角,采用球模型。
该函数使用
@turf/bearing库来计算从起点到终点的方位角。方位角的取值范围是 0 到 360 度。