Mechanical similarity as a generalization of scale symmetry