def cartesian_to_homogeneous(cartesian_matrix, matrix_type="<STR_LIT>"):
dimension_x, dimension_y = cartesian_matrix.shape<EOL>if matrix_type == "<STR_LIT>":<EOL><INDENT>homogeneous_matrix = np.eye(dimension_x + <NUM_LIT:1>)<EOL><DEDENT>elif matrix_type == "<STR_LIT>":<EOL><INDENT>homogeneous_matrix = sympy.eye(dimension_x + <NUM_LIT:1>)<EOL><DEDENT>homogeneous_matrix[:-<NUM_LIT:1>, :-<NUM_LIT:1>] = cartesian_matrix<EOL>return homogeneous_matrix<EOL>
Converts a cartesian matrix to an homogenous matrix