Where a Matrix Sends the Unit Square
~12 mincode completion
Implement transform_unit_square(M) returning a flat array of nine numbers: the transformed corners of (0,0),(1,0),(1,1),(0,1) in that order, each as x,y, followed by the signed area detM.
Where this shows up
~12 min
••••••••••••••••
8 employers weight this skill
4 quant funds, 2 defense companies, 2 autonomy companies. Top match scores 93.
Python
import numpy as np
def transform_unit_square(M):
"""
Apply a 2x2 matrix to the unit square.
Args:
M: 2x2 matrix [[a, b], [c, d]]
Returns:
array [x0, y0, x1, y1, x2, y2, x3, y3, signed_area] for the corners
(0,0), (1,0), (1,1), (0,1)
"""
# YOUR CODE HERE
pass