

 Amazon Redshift 將不再支援從修補程式 198 開始建立新的 Python UDFs。現有 Python UDF 將繼續正常運作至 2026 年 6 月 30 日。如需詳細資訊，請參閱[部落格文章](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# ST\$1Azimuth
<a name="ST_Azimuth-function"></a>

ST\$1Azimuth 會使用兩個輸入點的 2D 投影傳回以北為基礎的笛卡爾方位。

## 語法
<a name="ST_Azimuth-function-syntax"></a>

```
ST_Azimuth(point1, point2)
```

## 引數
<a name="ST_Azimuth-function-arguments"></a>

 *point1*   
`GEOMETRY` 資料類型的 `POINT` 值。*point1* 的空間參考系統識別碼 (SRID) 必須與 *point2* 的 SRID 相符。

 *point2*   
`GEOMETRY` 資料類型的 `POINT` 值。*point2* 的 SRID 必須與 *point1* 的 SRID 相符。

## 傳回類型
<a name="ST_Azimuth-function-return"></a>

數字，為 `DOUBLE PRECISION` 資料類型的角度 (弧度)。值的範圍介於 0 (含) 到 2 pi (不含)。

如果 *point1* 或 *point2* 是空點，則會傳回錯誤。

如果 *point1* 或 *point2* 為 Null，則會傳回 Null。

如果 *point1* 和 *point2* 相等，則會傳回 Null。

如果 *point1* 或 *point2* 不是點，則會傳回錯誤。

如果 *point1* 和 *point2* 沒有空間參考系統識別碼 (SRID) 的值，則會傳回錯誤。

## 範例
<a name="ST_Azimuth-function-examples"></a>

以下 SQL 會傳回輸入點的方位。

```
SELECT ST_Azimuth(ST_Point(1,2), ST_Point(5,6));
```

```
st_azimuth
-------------------
 0.7853981633974483
```