ee.Array.dotProduct

두 1차원 배열 간의 내적을 계산합니다.

사용반환 값
Array.dotProduct(array2)숫자
인수유형세부정보
array1배열첫 번째 1차원 배열입니다.
array2배열두 번째 1차원 배열입니다.

코드 편집기(JavaScript)

print(ee.Array([1]).dotProduct(ee.Array([2])));  // 2
print(ee.Array([1, 2]).dotProduct(ee.Array([3, 4])));  // 1*3 + 2*4 = 11
print(ee.Array([0, 1, 2]).dotProduct(ee.Array([3, 4, 5])));  // 0*3 + 1*4 + 2*5 = 14
print(ee.Array([-1, -2]).dotProduct(ee.Array([3, 4])));  // -1*3 + -2*4 = -11
print(ee.Array([1.5, 2.5]).dotProduct(ee.Array([3, 4])));  // 1.5*3 + 2.5*4 = 14.5

Python 설정

Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

import ee
import geemap.core as geemap

Colab (Python)

display(ee.Array([1]).dotProduct(ee.Array([2])))  # 2
display(ee.Array([1, 2]).dotProduct(ee.Array([3, 4])))  # 1*3 + 2*4 = 11
display(ee.Array([0, 1, 2]).dotProduct(ee.Array([3, 4, 5])))  # 0*3 + 1*4 + 2*5 = 14
display(ee.Array([-1, -2]).dotProduct(ee.Array([3, 4])))  # -1*3 + -2*4 = -11
display(ee.Array([1.5, 2.5]).dotProduct(ee.Array([3, 4])))  # 1.5*3 + 2.5*4 = 14.5