def rotate(obj, axis, angle, origin=None):
R = _rodrigues_to_dcm(axis, angle)<EOL>try:<EOL><INDENT>return obj.transform(PivotRotation(R, origin))<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise NotImplementedError<EOL><DEDENT>
Rotation around unit vector following the right hand rule

Parameters:
    obj : obj to be rotated (e.g. neurite, neuron).
        Must implement a transform method.
    axis : unit vector for the axis of rotation
    angle : rotation angle in rads

Returns:
    A copy of the object with the applied translation.