Arma 3 Scripting

vectorDotProduct

  • Arma 3 v1.22

Command · Markdown · JSON · original wiki page

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

vector1 vectorDotProduct vector2

Parameters:

Returns: Number

Examples

Example 1

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

See also

vectorAdd · vectorDiff · vectorCrossProduct · vectorCos · vectorMagnitude · vectorMagnitudeSqr · vectorMultiply · vectorDistance · vectorDistanceSqr · vectorDir · vectorUp · setVectorDir · setVectorUp · setVectorDirAndUp · vectorNormalized · vectorFromTo · matrixMultiply · matrixTranspose

Community notes

ffur2007slx2_5

Arma 3 v1.22 Algorithm:

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

It is recommended to use vectorDotProduct instead of BIS_fnc_dotProduct.