g_eucl: Euclidean metric tensor

g_eucl_cartR Documentation

Euclidean metric tensor

Description

Provides the Euclidean metric tensor of \mathbb{E}^n. g_eucl_cart() returns a numeric (constant) tensor in Cartesian coordinates,

ds^2=\sum_{i=1}^n dx_i^2

while g_eucl_sph() returns a symbolic tensor field in generalized spherical coordinates {r, \phi_1, \phi_2, ..., \phi_{n-1}}.

ds^2=dr^2 + r^2 d\Omega^2

Usage

g_eucl_cart(n, coords = paste0("x", 1:n))

g_eucl_sph(n, coords = c("r", paste0("ph", 1:(n - 1))))

Arguments

n

The dimension of the metric tensor.

coords

A character vector of coordinate names. The length needs to match the tensor dimensions.

Details

As usual, spherical coordinates are degenerate at r = 0 and \phi_l = 0, so be careful around those points.

Value

The covariant metric tensor as array imputed with coordinate names.

See Also

Wikipedia: Euclidean metric tensor

Other metric tensors: g_mink_cart(), g_sph(), g_ss(), metric_field()

Examples

g_eucl_cart(3)
g_eucl_cart(3) %_% .(+i, +j)
g_eucl_sph(3)
g_eucl_sph(3) %_% .(+i, +j)

ricci documentation built on Sept. 9, 2025, 5:56 p.m.