In geometry, the line element or length element can be informally thought of as a line segment associated with an infinitesimal displacement vector in a metric space. The length of the line element, which may be thought of as a differential arc length, is a function of the metric tensor and is written ds or dℓ.
Line elements are used in physics, especially in theories of gravitation (most notably general relativity) where spacetime is modelled as a curved Riemannian manifold with a metric tensor.
The coordinate-independent definition of the square of the line element ds in an n-dimensional metric space is:
where g is the metric tensor, · denotes inner product, and dq an infinitesimal displacement in the metric space.
In n-dimensional general curvilinear coordinates q = (q1, q2, q3, ..., qn), the square of arc length is:
where the indices i and j take values 1, 2, 3, ..., n. Common examples of metric spaces include three-dimensional space (no inclusion of time coordinates), and indeed four-dimensional spacetime. The metric is the origin of the line element, in addition to the surface and volume elements etc.