Anúncio: todos os projetos não comerciais registrados para usar o Earth Engine antes de
15 de abril de 2025 precisam
verificar a qualificação não comercial para manter o acesso. Se você não fizer a verificação até 26 de setembro de 2025, seu acesso poderá ser suspenso.
ee.Number.hypot
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Calcula a magnitude do vetor 2D [x, y].
| Uso | Retorna |
|---|
Number.hypot(right) | Número |
| Argumento | Tipo | Detalhes |
|---|
isso: left | Número | O valor à esquerda. |
right | Número | O valor à direita. |
Exemplos
Editor de código (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
Configuração do Python
Consulte a página
Ambiente Python para informações sobre a API Python e como usar
geemap para desenvolvimento interativo.
import ee
import geemap.core as geemap
Colab (Python)
# Left input is x and right input is y, representing point (x,y).
# 0
display('Length from origin to point (0,0):', ee.Number(0).hypot(0))
# 3
display('Length from origin to point (3,0):', ee.Number(3).hypot(0))
# 5
display('Length from origin to point (3,4):', ee.Number(3).hypot(4))
# 5
display('Length from origin to point (-3,4):', ee.Number(-3).hypot(4))
# 5
display('Length from origin to point (-3,-4):', ee.Number(-3).hypot(-4))
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-10-30 UTC.
[null,null,["Última atualização 2025-10-30 UTC."],[],["The `hypot` method calculates the magnitude of a 2D vector. It takes two numeric arguments, `left` (x-value) and `right` (y-value), and returns a `Number` representing the distance from the origin (0,0) to the point (x,y). The examples demonstrate that inputs of (0,0), (3,0), (3,4), (-3,4), and (-3,-4) result in magnitudes of 0, 3, 5, 5, and 5, respectively. The function is available in both JavaScript and Python.\n"]]