atan2()

使用 版本 下拉選單切換服務。 了解更多關於導航的資訊。
Apply to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel

計算正 X 軸與從原點到點 (y, x) 之間的角度,以弧度為單位。

語法

atan2( y,x)

深入瞭解 語法慣例。

參數

姓名 類型 必要 描述
y real ✔️ Y 座標。
x real ✔️ X 座標。

傳回

傳回正 X 軸與從原點到點 (y, x) 之間的弧度角度。

範例

下列範例會傳回弧度的角度度量。

print atan2_0 = atan2(1,1) // Pi / 4 radians (45 degrees)
| extend atan2_1 = atan2(0,-1) // Pi radians (180 degrees)
| extend atan2_2 = atan2(-1,0) // - Pi / 2 radians (-90 degrees)

輸出

atan2_0 atan2_1 atan2_2
0.785398163397448 3.14159265358979 -1.5707963267949