* @param x
     * @param decimalPlacePrecision
     * @param aRoundingMode
     * @return
     */
    public static BigDecimal cos(
            BigDecimal x,
            Generic_BigDecimal a_Generic_BigDecimal,
            int decimalPlacePrecision,
            RoundingMode aRoundingMode) {
        BigDecimal aPI = a_Generic_BigDecimal.get_PI();
        BigDecimal aPIBy2 = Generic_BigDecimal.divideRoundIfNecessary(
                aPI,
                BigInteger.valueOf(2),
                decimalPlacePrecision + 2,
                aRoundingMode);
        return sin(x.add(aPIBy2),
                a_Generic_BigDecimal,
                decimalPlacePrecision,
                aRoundingMode);
//        Generic_BigInteger aGeneric_BigInteger = a_Generic_BigDecimal._Generic_BigInteger;
//        BigDecimal aPI1000 = a_Generic_BigDecimal.get_PI();
//        // cosx = 1-(x^2)/(2!)+(x^4)/(4!)-(x^6)/(6!)+...
//        BigDecimal precision = new BigDecimal(BigInteger.ONE, decimalPlacePrecision + 2);
//        BigDecimal cosx = BigDecimal.ONE;
//        int factor = 2;
//        BigInteger factorial;
//        BigDecimal power;
//        boolean alternator = true;
//        while (true) {
//            factorial = aGeneric_BigInteger.factorial(factor);
//            power = Generic_BigDecimal.power(
//                    x,
//                    factor,
//                    decimalPlacePrecision + 2, aRoundingMode);
//            BigDecimal division = Generic_BigDecimal.divideRoundIfNecessary(
//                    power,
//                    factorial,
//                    decimalPlacePrecision + 2, aRoundingMode);
//            if (division.compareTo(precision) != -1) {
//                if (alternator) {
//                    alternator = false;
//                    cosx = cosx.subtract(division);
//                } else {
//                    alternator = true;
//                    cosx = cosx.add(division);
//                }
//            } else {
//                break;
//            }
//            factor += 2;
//        }
//        cosx = Generic_BigDecimal.roundIfNecessary(
//                cosx, decimalPlacePrecision, aRoundingMode);
//        return cosx;
    }