General-relativistic coordinates transformation support

I am looking for package that supports general-relativistic coordinates transformation to Cartesian etc. I would like to transform the following coordinates to Cartesian and vice versa. What will be the code if i have to do it manually?

For Kerr-Schild to Cartesian transformation i have following code:

function kerr2cart(spin,r,θ,ϕ)
    sθ, cθ = sincos(th)
    sϕ, cϕ = sincos(ph)
    X = (r*cϕ + spin*sϕ) * sθ
    Y = (r*sϕ - spin*cϕ) * sθ
    Z = r * cθ
    return X, Y, Z
end

Here spin is the rotational spin of the object(Black Hole etc.) that distorts geometry.

1 Like