---
name: "vectorCrossProduct"
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/vectorCrossProduct
revid: 378395
updated: 2026-04-04T07:56:27Z
---

# vectorCrossProduct

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

## Description

Cross product of two 3D vectors.

In layman's terms, if you have a polygon (surface) defined by 3 points, you can find a normal to it (just like terrain [surfaceNormal](../commands/surfaceNormal.md)). To invert direction of the normal, swap arguments around.

## Syntax

```sqf
vector1 vectorCrossProduct vector2
```

**Parameters:**

- `vector1`:  [Vector3D](../topics/Vector3D.md) or Vector2D - since Arma 3 v2.00, z coordinate is defaulted to 0 if not provided
- `vector2`:  [Vector3D](../topics/Vector3D.md) or Vector2D - since Arma 3 v2.00, z coordinate is defaulted to 0 if not provided

**Returns:** [Array](../topics/Array.md) -  vector [x, y, z]

## Examples

### Example 1

```sqf
_vector = [1,1,1] vectorCrossProduct [2,2,2];
```

### Example 2

```sqf
_vectorUp = [0,1,0] vectorCrossProduct [-1,0,0]; //[0,-0,1]
```

### Example 3

```sqf
_vectorSide = (vectorDir player) vectorCrossProduct (vectorUp player);
```

## See also

[vectorAdd](../commands/vectorAdd.md) · [vectorDiff](../commands/vectorDiff.md) · [vectorDotProduct](../commands/vectorDotProduct.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)

## Community notes

**ffur2007slx2_5** — 2014-06-28

Arma 3 v1.22Algorithm:

```sqf
Vector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2];
Result = [(y1 * z2) - (z1 * y2),(z1 * x2) - (x1 * z2),(x1 * y2) - (y1 * x2)];
```

It is recommended to use [vectorCrossProduct](../commands/vectorCrossProduct.md) instead of [BIS_fnc_crossProduct](../functions/BIS_fnc_crossProduct.md).

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