v1
- by hkotsubo 2/2/202300
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
function seno(x) {
    function fat(n) {
        if (n === 1)
            return 1;
        else {
            return n * fat(n - 1);
        }
    }
    return x - ((x ** 3) / fat(3)) + ((x ** 5) / fat(5)) - ((x ** 7) / fat(7));
}

function senoSemRecursao(x, limite = 7) {
    var result = x, sign = -1, denominador = 1;
    for (var factor = 3; factor <= limite; factor += 2) {
        denominador *= factor * (factor - 1);
        result += sign * (x ** factor) / denominador;
        sign *= -1;
    }
    return result;
}
delete caserun single casemove downdrag and drop case


ready



senoSemRecursao(Math.PI / 2)
delete caserun single casemove updrag and drop case


ready



seno(Math.PI / 2)
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN