Given a 2x2 transformation matrix and a list of 2D points, apply the matrix transformation to each point and return the transformed points.
def transform_matrix(A: list[list[int|float]], T: list[list[int|float]], S: list[list[int|float]]) -> list[list[float]]:
# Apply transformation: for each point, compute T * point + S (or just T * A)
# Assuming T is the transformation matrix and A is the set of points as columns
result = []
n = len(T)
m = len(A[0])
for i in range(n):
row = []
for j in range(m):
val = sum(T[i][k] * A[k][j] for k in range(len(A)))
row.append(val)
result.append(row)
return result