'Return the point after applying the transformation described
by the 4x4 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 == 4))
    except AttributeError:
        valid_matrix = False
    if (not valid_matrix):
        raise ValueError(('The    argument    to    the    transform    function    must    be    ' + 'a    4x4    matrix'))
    from sympy.matrices.expressions import Transpose
    (x, y, z) = self.args
    m = Transpose(matrix)
    return Point3D(*(Matrix(1, 4, [x, y, z, 1]) * m).tolist()[0][:3])
