Function cos

  • Returns the cosine of an angle in radians (can be in Bangla or English digits).

    Parameters

    • a: string | number

      Angle in radians (Bangla or English digits).

    • en: boolean = false

      If true, returns the result in English digits. Default is false (returns Bangla digits).

    • decimalPlaces: number = 12

      Number of decimal places to round the result. Default is 12.

    Returns string

    The cosine of a.

    cos("০"); // returns "১"
    cos(0, true); // returns "1"
    cos("৩.১৪", true); // returns "-1"
    cos("১.৫৭"); // returns "০"

    If the input is invalid or not a number.