Returns a new Space which is the same but rotated about a 
        given axis.
        
        If the axis given is ``None``, the rotation will be computed
        about the Space's centroid.
        
        :param angle: Rotation angle (in radians)
        :type angle: float
        :param direction: Axis direction ('x', 'y' or 'z')
        :type direction: str
        :param axis: Point in z=0 to perform as rotation axis
        :type axis: tuple (len=2 or 3) or None
        :returns: ``pyny.Space``

def rotate(self, angle, direction='z', axis=None):
        """
        Returns a new Space which is the same but rotated about a 
        given axis.
        
        If the axis given is ``None``, the rotation will be computed
        about the Space's centroid.
        
        :param angle: Rotation angle (in radians)
        :type angle: float
        :param direction: Axis direction ('x', 'y' or 'z')
        :type direction: str
        :param axis: Point in z=0 to perform as rotation axis
        :type axis: tuple (len=2 or 3) or None
        :returns: ``pyny.Space``
        """
        state = Polygon.verify
        Polygon.verify = False
        if axis is None:
            axis = self.get_centroid()
        else:
            if len(axis) == 2: axis = np.array([axis[0], axis[1], 0])
        map_ = self.get_map()[1] - axis
        
        ## Rotation matrix
        c = np.cos(angle)
        s = np.sin(angle)
        if direction == 'z':
            R = np.array([[c, -s, 0], [s, c, 0], [0, 0, 1]])
        elif direction == 'y':
            R = np.array([[c, 0, s], [0, 1, 0], [-s, 0, c]])
        elif direction == 'x':
            R = np.array([[1, 0, 0], [0, c, -s], [0, s, c]])
            
        rotated_ = np.dot(R, map_.T).T
        map_ = rotated_ + axis
        space = self.map2pyny(map_)
        Polygon.verify = state
        return space