---
name: "vectorDotProduct"
type: command
status: ok
groups: ["Math - Vectors"]
arma3_since: "1.22"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/vectorDotProduct
revid: 373021
updated: 2025-03-18T15:32:41Z
---

# vectorDotProduct

*Command · Math - Vectors · Arma 3 v1.22*

## Description

Dot product of two 3D vectors.

> [!NOTE]
> **Since Arma 3 v2.14:** Since Arma 3 v2.14 any count of numbers is valid, but both arrays must be same length.
>
> Before Arma 3 v2.14, the first argument had to be vector 3D, or Arma 3 v2.00 2D (With z coordinate defaulted to 0)

## Syntax

```sqf
vector1 vectorDotProduct vector2
```

**Parameters:**

- `vector1`: [Array](../topics/Array.md) of [Number](../topics/Number.md)s
- `vector2`: [Array](../topics/Array.md) of [Number](../topics/Number.md)s

**Returns:** [Number](../topics/Number.md)

## Examples

### Example 1

```sqf
_dot = [1,0,1] vectorDotProduct [0,0,2];
```

## See also

[vectorAdd](../commands/vectorAdd.md) · [vectorDiff](../commands/vectorDiff.md) · [vectorCrossProduct](../commands/vectorCrossProduct.md) · [vectorCos](../commands/vectorCos.md) · [vectorMagnitude](../commands/vectorMagnitude.md) · [vectorMagnitudeSqr](../commands/vectorMagnitudeSqr.md) · [vectorMultiply](../commands/vectorMultiply.md) · [vectorDistance](../commands/vectorDistance.md) · [vectorDistanceSqr](../commands/vectorDistanceSqr.md) · [vectorDir](../commands/vectorDir.md) · [vectorUp](../commands/vectorUp.md) · [setVectorDir](../commands/setVectorDir.md) · [setVectorUp](../commands/setVectorUp.md) · [setVectorDirAndUp](../commands/setVectorDirAndUp.md) · [vectorNormalized](../commands/vectorNormalized.md) · [vectorFromTo](../commands/vectorFromTo.md) · [matrixMultiply](../commands/matrixMultiply.md) · [matrixTranspose](../commands/matrixTranspose.md)

<sub>Source: [BI Community Wiki — vectorDotProduct](https://community.bistudio.com/wiki/vectorDotProduct) (revision 373021).</sub>
