Rotation invariant clustering and feature extraction