הודעה: כל הפרויקטים הלא מסחריים שנרשמו לשימוש ב-Earth Engine לפני
15 באפריל 2025 חייבים
לאמת את הזכאות לשימוש לא מסחרי כדי לשמור על הגישה. אם לא תאמתו את החשבון עד 26 בספטמבר 2025, יכול להיות שהגישה שלכם תושעה.
ee.Array.dotProduct
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Compute the dot product between two 1-D arrays.
| שימוש | החזרות |
|---|
Array.dotProduct(array2) | מספר |
| ארגומנט | סוג | פרטים |
|---|
זה: array1 | מערך | המערך החד-ממדי הראשון. |
array2 | מערך | המערך הדו-ממדי השני. |
דוגמאות
Code Editor (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 מפורט מידע על Python API ועל השימוש ב-geemap לפיתוח אינטראקטיבי.
import ee
import geemap.core as geemap
Colab (Python)
display(ee.Array([1]).dotProduct(ee.Array([2])).getInfo()) # 2
display(ee.Array([1, 2]).dotProduct(ee.Array([3, 4])).getInfo()) # 1*3 + 2*4 = 11
display(ee.Array([0, 1, 2]).dotProduct(ee.Array([3, 4, 5])).getInfo()) # 0*3 + 1*4 + 2*5 = 14
display(ee.Array([-1, -2]).dotProduct(ee.Array([3, 4])).getInfo()) # -1*3 + -2*4 = -11
display(ee.Array([1.5, 2.5]).dotProduct(ee.Array([3, 4])).getInfo()) # 1.5*3 + 2.5*4 = 14.5
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-10-20 (שעון UTC).
[null,null,["עדכון אחרון: 2025-10-20 (שעון UTC)."],[],["The core functionality is to compute the dot product of two one-dimensional arrays. The `dotProduct` method, applied to `array1`, takes `array2` as an argument. Both arrays must be 1-D. It returns a single numerical value representing the dot product result. The function operates by multiplying corresponding elements from each array, and then summing the products.\n"]]