{"name":"vectorNormalized","title":"vectorNormalized","type":"command","url":"https://community.bistudio.com/wiki/vectorNormalized","revid":378403,"updated":"2026-04-04T08:14:40Z","groups":["Math - Vectors"],"status":"ok","games":{"arma3":"1.26"},"since":"arma3 1.26","arma3_since":"1.26","description":"Returns normalised vector (unit vector, vectorMagnitude == 1) of given vector. If given vector is 0 result is a 0 vector as well.\n\n> [!NOTE]\n> - Arma 3 v2.14 any count of numbers is valid\n> - Arma 3 v2.00 now supports Vector2D (z defaulted to 0)\n> - Arma 3 v1.26 command introduction, only works with Vector3D","syntaxes":[{"syntax":"vectorNormalized vector","params":[{"name":"vector","type":"Array of Numbers","type_expr":"Array<Number>"}],"returns":{"type":"Vector3D","type_expr":"Vector3D"},"form":"unary","right":{"text":"vector"}}],"examples":[{"code":["vectorNormalized [12345,7890,38383]; // [0.300481,0.192045,0.934254]\nvectorMagnitude [0.300481,0.192045,0.934254]; // 1"]}],"see_also":["vectorDiff","vectorCrossProduct","vectorDotProduct","vectorCos","vectorMagnitude","vectorMagnitudeSqr","vectorMultiply","vectorDistance","vectorDistanceSqr","vectorDir","vectorUp","setVectorDir","setVectorUp","setVectorDirAndUp","vectorFromTo","matrixMultiply","matrixTranspose"],"notes":[{"user":"ffur2007slx2_5","date":"2014-07-19T15:13:00Z","text":"Arma 3 v1.26 Algorithm:\n\n```sqf\n_vector = [x,y,z];\n_result = [x / (sqrt (x ^ 2 + y ^ 2 + z ^ 2)), y / (sqrt (x ^ 2 + y ^ 2 + z ^ 2)), z / (sqrt (x ^ 2 + y ^ 2 + z ^ 2))];\n```\n\nIn mathematics, a unit vector in a normed vector space is a vector whose length is 1."}]}