  Kustaanheimo-Stiefel (KS) transformation depends on the choice of some
preferred direction in the Cartesian 3D space. This choice, seldom explicitly
mentioned, amounts typically to the direction of the first or the third
coordinate axis in celestial mechanics and atomic physics, respectively. The
present work develops a canonical KS transformation with an arbitrary preferred
direction, indicated by what we call a defining vector. Using a mix of vector
and quaternion algebra, we formulate the transformation in a reference frame
independent manner. The link between the oscillator and Keplerian first
integrals is given. As an example of the present formulation, the Keplerian
motion in a rotating frame is re-investigated.
