Skip to contents

Provides the metric tensor of the sphere \(S^n\) with radius 1. g_sph() returns a symbolic tensor field in generalized spherical coordinates \({\phi_1, \phi_2, ..., \phi_{n-1}}\). $$d\Omega^2= d\phi_1^2 + \sum_{i=1}^{n-1} \prod_{m=1}^{i-1} sin(\phi_m)^2 d\phi_i^2$$

Usage

g_sph(n, coords = paste0("ph", 1:n))

Arguments

n

The dimension of the metric tensor.

coords

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

Value

The covariant metric tensor as array imputed with coordinate names.

Details

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

See also

Wikipedia: Sphere

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

Examples

g_sph(3)
#> <Covariant metric tensor field> (ph1, ph2, ph3)
#>      [,1] [,2]         [,3]                         
#> [1,] "1"  "0"          "0"                          
#> [2,] "0"  "sin(ph1)^2" "0"                          
#> [3,] "0"  "0"          "(sin(ph1)^2) * (sin(ph2)^2)"
g_sph(3) %_% .(+i, +j)
#> <Labeled Array> [3x3] .(+i, +j)
#>      [,1] [,2]                 [,3]                                 
#> [1,] "1"  "0"                  "0"                                  
#> [2,] "0"  "(1) / (sin(ph1)^2)" "0"                                  
#> [3,] "0"  "0"                  "(1) / ((sin(ph1)^2) * (sin(ph2)^2))"