The metric tensor(see also metric), conventionally notated as
, is a 2-dimensional tensor (making it a matrix), that is used to measure distance and angle in a Riemannian geometry.
is conventionally used to notate the components of the metric tensor. (The elements of the matrix) (In the following, we use the Einstein summation convention)
The length of a segment of a curve parameterized by t, from a to b, is defined as:

The angle between two tangent vectors,
and
, is defined as:

To compute the metric tensor from a set of equations relating the space to cartesian space(gij = δij: see Kronecker delta for more details), compute the jacobian of the set of equations, and multiply (outer product) the transpose of that jacobian by the jacobian.

Example
Given a two-dimensional Euclidean metric tensor:

The length of a curve reduces to the familiar Calculus formula:

Some basic Euclidean metrics
Polar coordinates:

Cylindrical coordinates:

Spherical coordinates:
