# ee.Array.dotProduct

Compute the dot product between two 1-D arrays.

<br />

| Usage | Returns |
|---|---|
| `Array.dotProduct(array2)` | Number |

| Argument | Type | Details |
|---|---|---|
| this: `array1` | Array | The first 1-D array. |
| `array2` | Array | The second 1-D array. |

## Examples

### Code Editor (JavaScript)

```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 setup

See the [Python Environment](https://developers.google.com/earth-engine/guides/python_install) page for information on the Python API and using
`geemap` for interactive development.

```python
import ee
import geemap.core as geemap
```

### Colab (Python)

```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
```