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
def get_div_mat(matrice, n): elevated_matrice = powering_mat(n, matrice, matrice) return div_matrice(factorial(n), elevated_matrice)