Soem, the theory of relativity, or simply relativity, generally refers specifically to two theories of Albert Einstein: special relativity and general relativity. However, the word "relativity" is sometimes used in reference to Galilean invariance.

The term "theory of relativity" was coined by Max Planck in 1908 to emphasize how special relativity (and later, general relativity) uses the principle of relativity.

Special relativity is a theory of the structure of spacetime. It was introduced in Albert Einstein's 1905 paper "On the Electrodynamics of Moving Bodies" (for the contributions of many other physicists see History of special relativity). Special relativity is based on two postulates which are contradictory in classical mechanics:

1. The laws of physics are the same for all observers in uniform motion relative to one another (principle of relativity), 2. The speed of light in a vacuum is the same for all observers, regardless of their relative motion or of the motion of the source of the light.

The resultant theory agrees with experiment better than classical mechanics, e.g. in the Michelson-Morley experiment that supports postulate 2, but also has many surprising consequences. Some of these are:

* Relativity of simultaneity: Two events, simultaneous for some observer, may not be simultaneous for another observer if the observers are in relative motion. * Time dilation: Moving clocks are measured to tick more slowly than an observer's "stationary" clock. * Length contraction: Objects are measured to be shortened in the direction that they are moving with respect to the observer. * Mass-energy equivalence: E = mc2, energy and mass are equivalent and transmutable.

The defining feature of special relativity is the replacement of the Galilean transformations of classical mechanics by the Lorentz transformations. (See Maxwell's equations of electromagnetism and introduction to special relativity).

General relativity is a theory of gravitation developed by Einstein in the years 1907–1915. The development of general relativity began with the equivalence principle, under which the states of accelerated motion and being at rest in a gravitational field (for example when standing on the surface of the Earth) are physically identical. The upshot of this is that free fall is inertial motion; an object in free fall is falling because that is how objects move when there is no force being exerted on them, instead of this being due to the force of gravity as is the case in classical mechanics. This is incompatible with classical mechanics and special relativity because in those theories inertially moving objects cannot accelerate with respect to each other, but objects in free fall do so. To resolve this difficulty Einstein first proposed that spacetime is curved. In 1915, he devised the Einstein field equations which relate the curvature of spacetime with the mass, energy, and momentum within it.

Some of the consequences of general relativity are:

* Time goes more slowly in higher gravitational fields. This is called gravitational time dilation. * Orbits precess in a way unexpected in Newton's theory of gravity. (This has been observed in the orbit of Mercury and in binary pulsars). * Rays of light bend in the presence of a gravitational field. * Frame-dragging, in which a rotating mass "drags along" the space time around it.Technically, general relativity is a metric theory of gravitation whose defining feature is its use of the Einstein field equations. The solutions of the field equations are metric tensors which define the topology of the spacetime and how objects move inertially.