Rocking motion of two- and tree-dimensional freestanding rigid bodies: Formulation and parametrical analysis