geo_angle()

计算地球上两条直线之间的顺时针角度(以弧度为单位)。 第一条直线为 [point1, point2],第二条直线为 [point2, point3]。

语法

geo_angle(p1_longitude,p1_latitude,p2_longitude,p2_latitude,p3_longitude,p3_latitude)

详细了解语法约定

参数

客户 类型​​ 必需 说明
p1_longitude real 第一个地理空间坐标的经度值(度)。 有效值在 [-180, +180] 范围内。
p1_latitude real 第一个地理空间坐标的纬度值(度)。 有效值在 [-90, +90] 范围内。
p2_longitude real 第二个地理空间坐标的经度值(度)。 有效值在 [-180, +180] 范围内。
p2_latitude real 第二个地理空间坐标的纬度值(度)。 有效值在 [-90, +90] 范围内。
p3_longitude real 第二个地理空间坐标的经度值(度)。 有效值在 [-180, +180] 范围内。
p3_latitude real 第二个地理空间坐标的纬度值(度)。 有效值在 [-90, +90] 范围内。

返回

两条直线 [p1, p2] 和 [p2, p3] 之间的范围 [0, 2pi] 之间的弧度角度。 角度从第一条直线到第二条直线按顺时针方向测量。

注意

  • 对按照 WGS-84 坐标参考系统表示的地理空间坐标进行解释。
  • 用于测量地球上的距离的大地基准是一个球体。 直线边缘是球体上的测地线
  • 如果坐标无效,则查询将生成 null 结果。
  • 如果 point1 等于 point2,查询将生成 null 结果。
  • 如果 point2 等于 point3,查询将生成 null 结果。
  • 如果 point1 与 point2 正相反,查询将生成 null 结果。
  • 如果 point2 与 point3 正相反,查询将生成 null 结果。

示例

以下示例计算角度(以弧度为单位)。

print angle_in_radians = geo_angle(0, 10, 0,5, 3,-10)

输出

angle_in_radians
2.94493843406882

以下示例计算角度(以角度为单位)。

let angle_in_radians = geo_angle(0, 10, 0,5, 3,-10);
print angle_in_degrees = degrees(angle_in_radians)

输出

angle_in_degrees
168.732543198009

以下示例返回 null,因为第 1 个点等于第 2 个点。

print is_null = isnull(geo_angle(0, 10, 0, 10, 3, -10))

输出

is_null
True