Photon redshift for Schwarzschild black holes

https://en.wikipedia.org/wiki/Gravitational_redshift





       2 G M
 Rs = ------- 
        c^2

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

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

 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]

 Examples:

       Solar mass black hole observed from Earth:  http://rubor.org/schwarzschildarb.php
         Same but with an emitted visible photon:  http://rubor.org/schwarzschildarb.php?f2=0.565e15
                                 Sgr A* from 1au:  http://rubor.org/schwarzschildarb.php?M=4.1e6
           Gargantua from 3au (~Miller's planet):  http://rubor.org/schwarzschildarb.php?M=1e8&R1=4.48e11
      10 Sols & emit from 1m above EH in phase 2:  http://rubor.org/schwarzschildarb.php?M=10&d=1
                Msol, visible, emitted from Rsol:  http://rubor.org/schwarzschildarb.php?f2=0.565e15&d=6.957e8
Solar mass observed from Venus, emit a microwave:  http://rubor.org/schwarzschildarb.php?f2=2.45e9&R1=108208930000

                ESA 360° black hole visualisation
                A black hole system to play in Kerbal Space Program -- aesthetic, not physical


Mass M = 1 Msol
Schwarzschild radius Rs = 1.9747458161907E-8 a.u. (2.9541776986828km)

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

    d [m]          f1 [Hz]        z 
1.000000e+12	 1.000000e+20	-8.396640e-9 (-0.00)
1.000000e+11	 1.000000e+20	4.897159e-9 (0.00)
1.000000e+10	 9.999999e+19	1.378351e-7 (0.00)
1.000000e+9	 9.999985e+19	1.467214e-6 (0.00)
1.000000e+8	 9.999852e+19	1.476091e-5 (0.00)
1.000000e+7	 9.998523e+19	1.476881e-4 (0.00)
1.000000e+6	 9.985262e+19	1.475990e-3 (0.00)
1.000000e+5	 9.855485e+19	1.466337e-2 (0.01)
1.000000e+4	 8.786079e+19	1.381642e-1 (0.14)
1.000000e+3	 5.028887e+19	9.885114e-1 (0.99)
1.000000e+2	 1.809476e+19	4.526461e+0 (4.53)
1.000000e+1	 5.808285e+18	1.621679e+1 (16.22)
1.000000e+0	 1.839536e+18	5.336155e+1 (53.36)
1.000000e-1	 5.818008e+17	1.708801e+2 (170.88)
1.000000e-2	 1.839844e+17	5.425244e+2 (542.52)
1.000000e-3	 5.818106e+16	1.717772e+3 (1717.77)
1.000000e-4	 1.839847e+16	5.434235e+3 (5434.23)
1.000000e-5	 5.818107e+15	1.718672e+4 (17186.72)
1.000000e-6	 1.839847e+15	5.435135e+4 (54351.35)
1.000000e-7	 5.818107e+14	1.718762e+5 (171876.21)
1.000000e-8	 1.839847e+14	5.435225e+5 (543522.47)
1.000000e-9	 5.818107e+13	1.718771e+6 (1718771.13)
1.000000e-10	 1.839847e+13	5.435234e+6 (5435233.71)
1.000000e-11	 5.818107e+12	1.718772e+7 (17187720.32)
1.000000e-12	 1.839847e+12	5.435235e+7 (54352346.15)
1.000000e-13	 5.818107e+11	1.718772e+8 (171877212.16)
1.000000e-14	 1.839847e+11	5.435235e+8 (543523470.47)
1.000000e-15	 5.818107e+10	1.718772e+9 (1718772130.59)
1.000000e-16	 1.839847e+10	5.435235e+9 (5435234713.66)
1.000000e-17	 5.818107e+9	1.718772e+10 (17187721314.94)
1.000000e-18	 1.839847e+9	5.435235e+10 (54352347145.61)
1.000000e-19	 5.818107e+8	1.718772e+11 (171877213158.43)
1.000000e-20	 1.839847e+8	5.435235e+11 (543523471465.07)
1.000000e-21	 5.818107e+7	1.718772e+12 (1718772131593.33)
1.000000e-22	 1.839847e+7	5.435235e+12 (5435234714659.76)
1.000000e-23	 5.818107e+6	1.718772e+13 (17187721315942.28)
1.000000e-24	 1.839847e+6	5.435235e+13 (54352347146606.30)



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

R1 = Rs + [m]      f1 [Hz]        z 
1.000000e+0	3.162813e+17	315.17
1.000000e+1	1.001691e+17	997.31
1.000000e+2	3.215354e+16	3109.08
1.000000e+3	1.156937e+16	8642.51
1.000000e+4	6.621961e+15	15100.27
1.000000e+5	5.903420e+15	16938.33
1.000000e+6	5.826694e+15	17161.39
1.000000e+7	5.818966e+15	17184.18
1.000000e+8	5.818193e+15	17186.47
1.000000e+9	5.818115e+15	17186.70
1.000000e+10	5.818108e+15	17186.72
1.000000e+11	5.818107e+15	17186.72
1.000000e+12	5.818107e+15	17186.72
1.000000e+13	5.818107e+15	17186.72
1.000000e+14	5.818107e+15	17186.72
1.000000e+15	5.818107e+15	17186.72
1.000000e+16	5.818107e+15	17186.72
1.000000e+17	5.818107e+15	17186.72
1.000000e+18	5.818107e+15	17186.72
1.000000e+19	5.818107e+15	17186.72


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: http://rubor.org/schwarzschildarb.php?p1s=1e18&p1d=2&p1e=1e-32 Creative Commons Attribution by jussi.kantola @ gmail.com 2017 Visualizations by Professor Andrew Hamilton and used with permission. No guarantees on accuracy or correctness of the results. source code.