Unified derivation of the Galileo and the Lorentz transformations