{"name":"cos","title":"cos","type":"command","url":"https://community.bistudio.com/wiki/cos","revid":321053,"updated":"2022-05-13T12:15:18Z","groups":["Math - Geometry"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","description":"Cosine of a number, argument in degrees.","syntaxes":[{"syntax":"cos x","params":[{"name":"x","type":"Number","type_expr":"Number"}],"returns":{"type":"Number","type_expr":"Number"},"form":"unary","right":{"text":"x"}}],"examples":[{"code":["cos 60; // returns 0.5"]}],"see_also":["acos","sin","asin","tan","atan","atan2"],"notes":[{"user":"Hardrock","date":"2006-08-08T23:54:00Z","text":"Be aware that there might be rounding errors in the results of this command.\n\n```sqf\ncos 90\n```\n\nfor example doesn't return the expected '0', but '-4.37114e-008'. So, if you want to compare results of Cosinus, don't use the compare operator\n\n```sqf\n(cos 90) == 0\n```\n\nbut rather use less than.\n\n```sqf\n(cos 90) < 0.00001\n```"}]}