{I+=codeWee;} |
UINT64 factorial(UINT64 n) { if (n == 1) return 1; return n*factorial(n - 1); } // sin(x) = x - x^3/3! + x^5/5! - x^7/7! + ... double sine(double radian) { double result = radian; for (UINT64 n = 1; n < 9; n++) { result += (pow(radian, n * 2+1) / factorial(n * 2+1))*pow(-1, n); } return result; }