How can I transform this code to calculate the sin(x) in the method?

public static double getCos(double degrees, int n) {

double cos = 0;

double numerator = 0;

int denominator = 0;

for (int i = 0; i <= n; i++, i++) {

numerator = getNumerator(degrees, i);

denominator = getFactorial(2 * i + 1);

cos += numerator / denominator;