Example #1
0
def sinh(matrice):
    result = deepcopy(matrice)

    for n in range(1, 50):
        next_mat = div_matrice(factorial((2 * n) + 1), powering_mat((2 * n + 1), matrice, matrice))
        result = add_matrices(result, next_mat)
    return result
Example #2
0
def cosh(matrice):
    result = basic_mat(matrice)

    for n in range(1, 50):
        next_mat = div_matrice(factorial(2 * n),
                               powering_mat(2 * n, matrice, matrice))
        result = add_matrices(result, next_mat)
    return result
Example #3
0
def sin(matrice):
    result = deepcopy(matrice)

    for n in range(1, 50):
        next_mat = div_matrice(factorial(2 * n + 1) , powering_mat(2 * n + 1, matrice, matrice))
        if n % 2 != 0:
            result = sub_matrices(result, next_mat)
        else:
            result = add_matrices(result, next_mat)
    return result
Example #4
0
def get_div_mat(matrice, n):
    elevated_matrice = powering_mat(n, matrice, matrice)
    return div_matrice(factorial(n), elevated_matrice)