{"name":"vectorNormalized","operator":null,"title":"vectorNormalized","type":"command","url":"https://community.bistudio.com/wiki/vectorNormalized","revid":378403,"updated":"2026-04-04T08:14:40Z","groups":["Math - Vectors"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.26"}],"since":{"game":"arma3","name":"Arma 3","version":"1.26"},"arma3_since":"1.26","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"vector","type":"Array of Numbers","optional":false,"default":null,"description":null,"types":["Array","Number"],"since":null,"text":"vector: Array of Numbers"}],"returns":{"type":"Vector3D","types":["Vector3D"],"description":null,"text":"Vector3D"},"form":"unary","operator":null,"left":null,"right":{"text":"vector","types":["Array","Number"]}}],"examples":[{"text":"```sqf\nvectorNormalized [12345,7890,38383]; // [0.300481,0.192045,0.934254]\nvectorMagnitude [0.300481,0.192045,0.934254]; // 1\n```","code":["vectorNormalized [12345,7890,38383]; // [0.300481,0.192045,0.934254]\nvectorMagnitude [0.300481,0.192045,0.934254]; // 1"]}],"multiplayer":null,"problems":null,"aliases":[],"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."}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Math - Vectors","Introduced with Arma 3 version 1.26","Scripting Commands"]}