def mat_mult(t, points):
    """
    Multiplies the 3x3 transform matrix with a list of points
    All this happens in 'homogeneous coordinates' so the points
    are assumed to be lie the z=1 plane, as (x,y,1). However,
    the output is placed back on the z=0 plane so it can be
    plotted on the sketch plane.
    """

    p_out = []
    for p in points:
        px = p[0] * t[0][0] + p[1] * t[0][1] + t[0][2]
        py = p[0] * t[1][0] + p[1] * t[1][1] + t[1][2]
        p_out.append([px, py, 0.0])

    return p_out