{"name":"vectorDotProduct","title":"vectorDotProduct","type":"command","url":"https://community.bistudio.com/wiki/vectorDotProduct","revid":379481,"updated":"2026-10-31T00:12:16Z","groups":["Math - Vectors"],"status":"ok","games":{"arma3":"1.22"},"since":"arma3 1.22","arma3_since":"1.22","description":"Dot product of two 3D vectors.\n\n> [!NOTE]\n> **Since Arma 3 v2.14:** Since Arma 3 v2.14 any count of numbers is valid, but both arrays must be same length.\n> 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)","syntaxes":[{"syntax":"vector1 vectorDotProduct vector2","params":[{"name":"vector1","type":"Array of Numbers","type_expr":"Array<Number>"},{"name":"vector2","type":"Array of Numbers","type_expr":"Array<Number>"}],"returns":{"type":"Number","type_expr":"Number"},"form":"binary","left":{"text":"vector1"},"right":{"text":"vector2"}}],"examples":[{"code":["_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"],"notes":[{"user":"ffur2007slx2_5","date":"2014-06-28T00:00:00Z","text":"Arma 3 v1.22 Algorithm:\n\n```sqf\nVector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2];\nResult = (x1 * x2) + (y1 * y2) + (z1 * z2);\n```\n\nIt is recommended to use vectorDotProduct instead of BIS_fnc_dotProduct."}]}