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 in that order, each as , followed by the signed area .

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
Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.