{"name":"cos","operator":null,"title":"cos","type":"command","url":"https://community.bistudio.com/wiki/cos","revid":321053,"updated":"2022-05-13T12:15:18Z","groups":["Math - Geometry"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Cosine of a number, argument in degrees.","syntaxes":[{"syntax":"cos x","since":null,"effect":null,"exec":null,"params":[{"name":"x","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"x: Number"}],"returns":{"type":"Number","types":["Number"],"description":null,"text":"Number"},"form":"unary","operator":null,"left":null,"right":{"text":"x","types":["Number"]}}],"examples":[{"text":"```sqf\ncos 60; // returns 0.5\n```","code":["cos 60; // returns 0.5"]}],"multiplayer":null,"problems":null,"aliases":[],"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```"}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Math - Geometry","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}