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$$
Details
As usual, spherical coordinates are degenerate at \(r = 0\) and \(\phi_l = 0\), so be careful around those points.
See also
Wikipedia: Euclidean metric tensor
Other metric tensors:
g_mink_cart()
,
g_sph()
,
g_ss()
,
metric_field()
Examples
g_eucl_cart(3)
#> <Covariant metric tensor field> (x1, x2, x3)
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
g_eucl_cart(3) %_% .(+i, +j)
#> <Labeled Array> [3x3] .(+i, +j)
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
g_eucl_sph(3)
#> <Covariant metric tensor field> (r, ph1, ph2)
#> [,1] [,2] [,3]
#> [1,] "1" "0" "0"
#> [2,] "0" "r^2*1" "0"
#> [3,] "0" "0" "r^2*sin(ph1)^2"
g_eucl_sph(3) %_% .(+i, +j)
#> <Labeled Array> [3x3] .(+i, +j)
#> [,1] [,2] [,3]
#> [1,] "1" "0" "0"
#> [2,] "0" "(1) / (r^2*1)" "0"
#> [3,] "0" "0" "(1) / (r^2*sin(ph1)^2)"