{"name":"vectorCrossProduct","title":"vectorCrossProduct","type":"command","url":"https://community.bistudio.com/wiki/vectorCrossProduct","revid":378395,"updated":"2026-04-04T07:56:27Z","groups":["Math - Vectors"],"status":"ok","games":{"arma3":"1.22"},"since":"arma3 1.22","arma3_since":"1.22","description":"Cross product of two 3D vectors.\n\nIn layman's terms, if you have a polygon (surface) defined by 3 points, you can find a normal to it (just like terrain surfaceNormal). To invert direction of the normal, swap arguments around.","syntaxes":[{"syntax":"vector1 vectorCrossProduct vector2","params":[{"name":"vector1","type":"Vector3D or Vector2D","description":"since Arma 3 v2.00, z coordinate is defaulted to 0 if not provided","type_expr":"Vector3D | Vector2D"},{"name":"vector2","type":"Vector3D or Vector2D","description":"since Arma 3 v2.00, z coordinate is defaulted to 0 if not provided","type_expr":"Vector3D | Vector2D"}],"returns":{"type":"Array","type_expr":"Array","description":"vector [x, y, z]"},"form":"binary","left":{"text":"vector1"},"right":{"text":"vector2"}}],"examples":[{"code":["_vector = [1,1,1] vectorCrossProduct [2,2,2];"]},{"code":["_vectorUp = [0,1,0] vectorCrossProduct [-1,0,0]; //[0,-0,1]"]},{"code":["_vectorSide = (vectorDir player) vectorCrossProduct (vectorUp player);"]}],"see_also":["vectorAdd","vectorDiff","vectorDotProduct","vectorCos","vectorMagnitude","vectorMagnitudeSqr","vectorMultiply","vectorDistance","vectorDistanceSqr","vectorDir","vectorUp","setVectorDir","setVectorUp","setVectorDirAndUp","vectorNormalized","vectorFromTo","matrixMultiply","matrixTranspose"],"notes":[{"user":"ffur2007slx2_5","date":"2014-06-28T09:12:00Z","text":"Arma 3 v1.22Algorithm:\n\n```sqf\nVector1 = [x1,y1,z1]; Vector2 = [x2,y2,z2];\nResult = [(y1 * z2) - (z1 * y2),(z1 * x2) - (x1 * z2),(x1 * y2) - (y1 * x2)];\n```\n\nIt is recommended to use vectorCrossProduct instead of BIS_fnc_crossProduct."}]}