ee.Number.hypot

2D ベクトル [x, y] の大きさを計算します。

用途戻り値
Number.hypot(right)数値
引数タイプ詳細
これ: left数値左側の値。
right数値右側の値。

コードエディタ(JavaScript)

// Left input is x and right input is y, representing point (x,y).
print('Length from origin to point (0,0)', ee.Number(0).hypot(0));  // 0
print('Length from origin to point (3,0)', ee.Number(3).hypot(0));  // 3
print('Length from origin to point (3,4)', ee.Number(3).hypot(4));  // 5
print('Length from origin to point (-3,4)', ee.Number(-3).hypot(4));  // 5
print('Length from origin to point (-3,-4)', ee.Number(-3).hypot(-4));  // 5

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

# Left input is x and right input is y, representing point (x,y).
# 0
print('Length from origin to point (0,0):', ee.Number(0).hypot(0).getInfo())
# 3
print('Length from origin to point (3,0):', ee.Number(3).hypot(0).getInfo())
# 5
print('Length from origin to point (3,4):', ee.Number(3).hypot(4).getInfo())
# 5
print('Length from origin to point (-3,4):', ee.Number(-3).hypot(4).getInfo())
# 5
print('Length from origin to point (-3,-4):', ee.Number(-3).hypot(-4).getInfo())