def apply_to(self, x, columns=False):
if isinstance(x, np.ndarray) and len(x.shape) == <NUM_LIT:2> and x.shape[<NUM_LIT:0>] == <NUM_LIT:3> and columns:<EOL><INDENT>return np.dot(self.r, x)<EOL><DEDENT>if isinstance(x, np.ndarray) and (x.shape == (<NUM_LIT:3>, ) or (len(x.shape) == <NUM_LIT:2> and x.shape[<NUM_LIT:1>] == <NUM_LIT:3>)) and not columns:<EOL><INDENT>return np.dot(x, self.r.transpose())<EOL><DEDENT>elif isinstance(x, Complete):<EOL><INDENT>return Complete(np.dot(self.r, x.r), np.dot(self.r, x.t))<EOL><DEDENT>elif isinstance(x, Translation):<EOL><INDENT>return Complete(self.r, np.dot(self.r, x.t))<EOL><DEDENT>elif isinstance(x, Rotation):<EOL><INDENT>return Rotation(np.dot(self.r, x.r))<EOL><DEDENT>elif isinstance(x, UnitCell):<EOL><INDENT>return UnitCell(np.dot(self.r, x.matrix), x.active)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % x)<EOL><DEDENT>
Apply this rotation to the given object

           The argument can be several sorts of objects:

           * ``np.array`` with shape (3, )
           * ``np.array`` with shape (N, 3)
           * ``np.array`` with shape (3, N), use ``columns=True``
           * ``Translation``
           * ``Rotation``
           * ``Complete``
           * ``UnitCell``

           In case of arrays, the 3D vectors are rotated. In case of trans-
           formations, a transformation is returned that consists of this
           rotation applied AFTER the given translation. In case of a unit cell,
           a unit cell with rotated cell vectors is returned.

           This method is equivalent to ``self*x``.