Documentation/Calc Functions/COS

    From The Document Foundation Wiki


    Function name:

    COS

    Category:

    Mathematical

    Summary:

    Calculates the trigonometric cosine (cos) of an angle expressed in radians.

    Syntax:

    COS(Number)

    Returns:

    Returns a real number in the range [-1, 1] that is the trigonometric cosine of the specified angle.

    Arguments:

    Number is a real number, or a reference to a cell containing that number, that is the angle in radians whose trigonometric cosine is to be calculated.

    • If Number is non-numeric, then COS reports a #VALUE! error.

    Additional details:

    If your angle is expressed in degrees, either multiply by PI()/180 or use the RADIANS function to convert to radians.

    The formula for the trigonometric cosine of x is:

    [math]\displaystyle{ \cos(x)~=~\sum_{n=0}^{\infty }\frac{(-1)^{n}}{(2n)!}~x^{2n} }[/math]

    The figure below illustrates the function COS.

    COS function

    Examples:

    Formula Description Returns
    =COS(1) Trigonometric cosine of 1 radian. 0.54030230586814
    =COS(D1) where cell D1 contains the number -0.5. Trigonometric cosine of -½ radian. 0.877582561890373
    =COS(PI()*2) Trigonometric cosine of 2π radians. 1
    =COS(RADIANS(60)) Trigonometric cosine of 60°, after first converting the angle from degrees to radians. 0.5
    =DEGREES(ACOS(COS(RADIANS(60))) An angle of 60° is converted to radians, its cosine is taken, then the inverse cosine of that value is calculated, and finally the result is converted back to degrees. 60

    Related LibreOffice functions:

    ACOS

    COT

    CSC

    SEC

    SIN

    TAN

    ODF standard:

    Section 6.16.19, part 2

    Related (or similar) Excel functions:

    COS