COS function
Note: This draft page is under construction 🚧
Overview
COS is a function of the Math and Trigonometry category that calculates the trigonometric cosine of an angle, returning a value in the range [-1, +1].
Usage
Syntax
COS(angle) => cos
Argument descriptions
- angle (number, required). The angle whose cosine is to be calculated, expressed in radians. To convert between degrees and radians, use the relation below. Alternatively, use the DEGREES or RADIANS functions.
Additional guidance
None.
Returned value
COS returns a unitless number that is the trigonometric cosine of the specified angle.
Error conditions
- In common with many other IronCalc functions, COS propagates errors that are found in its argument.
- If no argument, or more than one argument, is supplied, then COS returns the
#ERROR!
error. - If the value of the angle argument is not (or cannot be converted to) a number, then COS returns the
#VALUE!
error. - For some argument values, COS may return a
#DIV/0!
error. - For more information about the different types of errors that you may encounter when using IronCalc functions, visit our Error Types page.
Details
- The COS function utilizes the cos() method provided by the Rust Standard Library.
- The figure below illustrates the output of the COS function for angles
in the range -2 to +2 radians.
Examples
See some examples in IronCalc.
Links
- For more information about trigonometric cosine, visit Wikipedia's Sine and cosine page.
- See also IronCalc's ACOS, SIN and TAN functions.
- Visit Microsoft Excel's COS function page.
- Both Google Sheets and LibreOffice Calc provide versions of the COS function.