ee.Number.atan2

Tính góc được tạo bởi vectơ 2D [x, y].

Cách sử dụngGiá trị trả về
Number.atan2(right)Số
Đối sốLoạiThông tin chi tiết
this: leftSốGiá trị bên trái.
rightSốGiá trị bên phải.

Ví dụ

Trình soạn thảo mã (JavaScript)

// Left input is x and right input is y, representing point (x,y).
print('Atan2 of point (0,0)', ee.Number(0).atan2(0));  // 0
print('Atan2 of point (1,0)', ee.Number(1).atan2(0));  // 0
print('Atan2 of point (0,1)', ee.Number(0).atan2(1));  // 1.570796326 (π/2)
print('Atan2 of point (-1,0)', ee.Number(-1).atan2(0));  // 3.141592653 (π)
print('Atan2 of point (0,-1)', ee.Number(0).atan2(-1));  // -1.570796326 (-π/2)

Thiết lập Python

Hãy xem trang Môi trường Python để biết thông tin về API Python và cách sử dụng geemap cho quá trình phát triển tương tác.

import ee
import geemap.core as geemap

Colab (Python)

print('Atan2 of point (0,0):', ee.Number(0).atan2(0).getInfo())  # 0
print('Atan2 of point (1,0):', ee.Number(1).atan2(0).getInfo())  # 0
# 1.570796326 (π/2)
print('Atan2 of point (0,1):', ee.Number(0).atan2(1).getInfo())
# 3.141592653 (π)
print('Atan2 of point (-1,0):', ee.Number(-1).atan2(0).getInfo())
# -1.570796326 (-π/2)
print('Atan2 of point (0,-1):', ee.Number(0).atan2(-1).getInfo())