'Return the point after applying the transformation described
by the 3x3 Matrix, ``matrix``.
See Also
geometry.entity.rotate
geometry.entity.scale
geometry.entity.translate'

def transform(self, matrix):

    try:
        (col, row) = matrix.shape
        valid_matrix = (matrix.is_square and (col == 3))
    except AttributeError:
        valid_matrix = False
    if (not valid_matrix):
        raise ValueError(('The    argument    to    the    transform    function    must    be    ' + 'a    3x3    matrix'))
    (x, y) = self.args
    return Point(*(Matrix(1, 3, [x, y, 1]) * matrix).tolist()[0][:2])
