Photon redshift for Schwarzschild black holes

       2 G M
 Rs = ------- 

                R1 (R2 - Rs)
 f1 = f2 sqrt[ -------------- ]
                R2 (R1 - Rs)

       f2 - f1
  z = ---------

 Where Rs = Schwarzschild radius 
        M = black hole mass
        G = gravitational constant
        c = speed of light in vacuum
       f1 = observed frequency
       R1 = observer distance from singularity (ie. center of mass of the black hole), > Rs
       f2 = emitted frequency 
       R2 = emitter distance from singularity, > Rs
        z = redshift
      [-z = blueshift]

 Calculated in two phases,
 phase 1:  Photon redshift from different emitter distances as observed at R1.
 Emitter starts at 1e12 meters away from the black hole, and approaches
 all the way to 1e-24m (billionth of a proton radius, or so).
 For each emitter distance, observed frequency [Hz] and redshift [dimensionless] are displayed.

 phase 2:  Photon redshift from selected emitter distance at different observer distances.
 Observer starts at 1 meter away from the event horizon, and gains distance
 up the decades all the way to 1e18m (>100ly)
 For each observer distance, observed frequency [Hz] and redshift [dimensionless] are displayed.

 Input as optional GET parameters [with default]:
        M = mass in Msols [1]
       R1 = observer distance in meters [1.49597871e11]
       f2 = emitted frequency in Hertz' [1e20]
        d = emitter distance from event horizon in phase 2 in meters [0.001]
   DIGITS = request more decimal places for calculations [128]


       Solar mass black hole observed from Earth:
         Same but with an emitted visible photon:
                                 Sgr A* from 1au:
           Gargantua from 3au (~Miller's planet):
      10 Sols & emit from 1m above EH in phase 2:
                Msol, visible, emitted from Rsol:
Solar mass observed from Venus, emit a microwave:

                ESA 360° black hole visualisation

Mass M = 4100000 Msol
Schwarzschild radius Rs = 0.080964578463818 a.u. (12112128.5646km)

Phase 1:  emitter moves towards event horizon
Emission distance R2 = Rs + d (variable)
Observer distance R1 = 2.500000e+20m
Emitted frequency f2 = 1.0E+20Hz

    d [m]          f1 [Hz]        z 
3.000000e+20	 1.000000e+20	-4.037509e-12 (-0.00)
3.000000e+19	 1.000000e+20	1.776445e-10 (0.00)
3.000000e+18	 1.000000e+20	1.994464e-9 (0.00)
3.000000e+17	 1.000000e+20	2.016266e-8 (0.00)
3.000000e+16	 9.999998e+19	2.018446e-7 (0.00)
3.000000e+15	 9.999980e+19	2.018662e-6 (0.00)
3.000000e+14	 9.999798e+19	2.018665e-5 (0.00)
3.000000e+13	 9.997982e+19	2.018484e-4 (0.00)
3.000000e+12	 9.979874e+19	2.016655e-3 (0.00)
3.000000e+11	 9.804045e+19	1.998714e-2 (0.02)
3.000000e+10	 8.440283e+19	1.847943e-1 (0.18)
3.000000e+9	 4.455514e+19	1.244410e+0 (1.24)
3.000000e+8	 1.554667e+19	5.432244e+0 (5.43)
3.000000e+7	 4.970650e+18	1.911809e+1 (19.12)
3.000000e+6	 1.573608e+18	6.254822e+1 (62.55)
3.000000e+5	 4.976741e+17	1.999347e+2 (199.93)
3.000000e+4	 1.573801e+17	6.344043e+2 (634.40)
3.000000e+3	 4.976802e+16	2.008323e+3 (2008.32)
3.000000e+2	 1.573803e+16	6.353035e+3 (6353.04)
3.000000e+1	 4.976802e+15	2.009222e+4 (20092.22)
3.000000e+0	 1.573803e+15	6.353935e+4 (63539.35)
3.000000e-1	 4.976802e+14	2.009312e+5 (200931.23)
3.000000e-2	 1.573803e+14	6.354025e+5 (635402.51)
3.000000e-3	 4.976802e+13	2.009321e+6 (2009321.32)
3.000000e-4	 1.573803e+13	6.354034e+6 (6354034.09)
3.000000e-5	 4.976802e+12	2.009322e+7 (20093222.21)
3.000000e-6	 1.573803e+12	6.354035e+7 (63540349.86)
3.000000e-7	 4.976802e+11	2.009322e+8 (200932231.06)
3.000000e-8	 1.573803e+11	6.354035e+8 (635403507.65)
3.000000e-9	 4.976802e+10	2.009322e+9 (2009322319.59)
3.000000e-10	 1.573803e+10	6.354035e+9 (6354035085.47)
3.000000e-11	 4.976802e+9	2.009322e+10 (20093223204.86)
3.000000e-12	 1.573803e+9	6.354035e+10 (63540350863.66)
3.000000e-13	 4.976802e+8	2.009322e+11 (200932232057.58)
3.000000e-14	 1.573803e+8	6.354035e+11 (635403508645.61)
3.000000e-15	 4.976802e+7	2.009322e+12 (2009322320584.78)
3.000000e-16	 1.573803e+7	6.354035e+12 (6354035086465.10)
3.000000e-17	 4.976802e+6	2.009322e+13 (20093223205856.87)
3.000000e-18	 1.573803e+6	6.354035e+13 (63540350864659.93)
3.000000e-19	 4.976802e+5	2.009322e+14 (200932232058578.69)
3.000000e-20	 1.573803e+5	6.354035e+14 (635403508646612.00)
3.000000e-21	 4.976802e+4	2.009322e+15 (2009322320585786.75)
3.000000e-22	 1.573803e+4	6.354035e+15 (6354035086466120.00)
3.000000e-23	 4.976802e+3	2.009322e+16 (20093223205857868.00)
3.000000e-24	 1.573803e+3	6.354035e+16 (63540350864661208.00)
3.000000e-25	 4.976802e+2	2.009322e+17 (200932232058578656.00)

Phase 2:  observer moves away from the horizon
Emission distance R2 = Rs + 1.000000e+12m
Observer distance R1 = variable
Emitted frequency f2 = 1.0E+20Hz

R1 = Rs + [m]      f1 [Hz]        z 
1.000000e+0	1.093946e+25	-1.00
1.000000e+1	3.459361e+24	-1.00
1.000000e+2	1.093946e+24	-1.00
1.000000e+3	3.459361e+23	-1.00
1.000000e+4	1.093947e+23	-1.00
1.000000e+5	3.459376e+22	-1.00
1.000000e+6	1.093991e+22	-0.99
1.000000e+7	3.460789e+21	-0.97
1.000000e+8	1.098453e+21	-0.91
1.000000e+9	3.599335e+20	-0.72
1.000000e+10	1.478090e+20	-0.32
1.000000e+11	1.052475e+20	-0.05
1.000000e+12	1.000000e+20	0.00
1.000000e+13	9.946002e+19	0.01
1.000000e+14	9.940586e+19	0.01
1.000000e+15	9.940044e+19	0.01
1.000000e+16	9.939990e+19	0.01
1.000000e+17	9.939985e+19	0.01
1.000000e+18	9.939984e+19	0.01
1.000000e+19	9.939984e+19	0.01

Bonus GET parameters for controlling the loops: p1s = phase 1 loop start, 'outerspace', f.e. 1e24 p1d = phase 1 loop step divider, f.e. 10 or 1e1 (must be > 1) p1e = phase 1 loop end, ~event horizon, f.e. 1e-32 p2s = phase 2 loop start, ~event horizon, f.e. 1e-24 p2d = phase 2 loop step multiplier, f.e. 10 or 1e1 p2e = phase 2 loop end, 'outerspace', f.e. 1e32 Input is handled via PHPs sprintf, which limits numerical range for mass/distance to about 53 decades; the proton mass divided by solar mass is < 1e-57, and therefore proton horizon is intractable (until I maybe fix it). Example: Creative Commons Attribution by jussi.kantola @ 2017 Visualizations by Professor Andrew Hamilton and used with permission. No guarantees on accuracy or correctness of the results. source code.