def exp(matrice): original_mat = deepcopy(matrice) matrice = add_matrices(matrice, basic_mat(matrice)) for n in range(2, 100): matrice = add_matrices(matrice, get_div_mat(original_mat, n)) return matrice
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
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
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