diff --git a/compute.py b/compute.py index bc22144..97d588c 100644 --- a/compute.py +++ b/compute.py @@ -17,7 +17,18 @@ def matmul(matrix_a:list[list[float]], matrix_b: list[list[float]]) -> list[list if len(matrix_a[0]) != len(matrix_b): raise ValueError("Differing Matrix Size") target_height = len(matrix_a) - target_width = len(matrix_b[0])idth]) + target_width = len(matrix_b[0]) + + end_matrix : list[list[float]]= [] + + + for height in range(target_height): + end_matrix.append([]) + for width in range(target_width): + row = matrix_a[height] + column_ = [] + for b in matrix_b: + column_.append(b[width]) result_quarter = 0 for i in range(len(row)): result_quarter += row[i] * column_[i] @@ -52,16 +63,18 @@ def transpose(matrix:list[list[float]]) -> list[list[float]]: return transposed_matrix def rot_2d(angle:float) -> list[list[float]]: - """3rhb1tng :return: The Rotation Matrix + """ + Creates a Rotation Matrix out of the given angle + :param angle: The rotation in radians + :type angle: float + :return: The Rotation Matrix :rtype: list[list[float]] """ sin = round(math.sin(angle), 4) cos = round(math.cos(angle), 4) return [[cos, -sin], - [sin, cos]]sfbweb - eg72g2748g#3 + [sin, cos]] - def leakCredit card info