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 = 100000000 Msol
Schwarzschild radius Rs = 1.9747458161907 a.u. (295417769.86828km)

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

    d [m]          f1 [Hz]        z 
1.000000e+12	 1.505505e+20	-3.357709e-1 (-0.34)
1.000000e+11	 8.617056e+19	1.604891e-1 (0.16)
1.000000e+10	 3.100558e+19	2.225226e+0 (2.23)
1.000000e+9	 9.952562e+18	9.047664e+0 (9.05)
1.000000e+8	 3.152065e+18	3.072523e+1 (30.73)
1.000000e+7	 9.969224e+17	9.930871e+1 (99.31)
1.000000e+6	 3.152594e+17	3.161991e+2 (316.20)
1.000000e+5	 9.969391e+16	1.002070e+3 (1002.07)
1.000000e+4	 3.152599e+16	3.170986e+3 (3170.99)
1.000000e+3	 9.969393e+15	1.002970e+4 (10029.70)
1.000000e+2	 3.152599e+15	3.171886e+4 (31718.86)
1.000000e+1	 9.969393e+14	1.003060e+5 (100306.01)
1.000000e+0	 3.152599e+14	3.171976e+5 (317197.61)
1.000000e-1	 9.969393e+13	1.003069e+6 (1003069.09)
1.000000e-2	 3.152599e+13	3.171985e+6 (3171985.13)
1.000000e-3	 9.969393e+12	1.003070e+7 (10030699.88)
1.000000e-4	 3.152599e+12	3.171986e+7 (31719860.31)
1.000000e-5	 9.969393e+11	1.003070e+8 (100307007.80)
1.000000e-6	 3.152599e+11	3.171986e+8 (317198612.10)
1.000000e-7	 9.969393e+10	1.003070e+9 (1003070087.03)
1.000000e-8	 3.152599e+10	3.171986e+9 (3171986129.95)
1.000000e-9	 9.969393e+9	1.003070e+10 (10030700879.28)
1.000000e-10	 3.152599e+9	3.171986e+10 (31719861308.54)
1.000000e-11	 9.969393e+8	1.003070e+11 (100307008801.80)
1.000000e-12	 3.152599e+8	3.171986e+11 (317198613094.40)
1.000000e-13	 9.969393e+7	1.003070e+12 (1003070088026.97)
1.000000e-14	 3.152599e+7	3.171986e+12 (3171986130952.99)
1.000000e-15	 9.969393e+6	1.003070e+13 (10030700880278.77)
1.000000e-16	 3.152599e+6	3.171986e+13 (31719861309539.05)
1.000000e-17	 9.969393e+5	1.003070e+14 (100307008802796.67)
1.000000e-18	 3.152599e+5	3.171986e+14 (317198613095400.00)
1.000000e-19	 9.969393e+4	1.003070e+15 (1003070088027976.62)
1.000000e-20	 3.152599e+4	3.171986e+15 (3171986130954000.50)
1.000000e-21	 9.969393e+3	1.003070e+16 (10030700880279768.00)
1.000000e-22	 3.152599e+3	3.171986e+16 (31719861309540008.00)
1.000000e-23	 9.969393e+2	1.003070e+17 (100307008802797664.00)
1.000000e-24	 3.152599e+2	3.171986e+17 (317198613095400000.00)



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

R1 = Rs + [m]      f1 [Hz]        z 
1.000000e+0	3.162278e+18	30.62
1.000000e+1	1.000000e+18	99.00
1.000000e+2	3.162278e+17	315.23
1.000000e+3	1.000000e+17	999.00
1.000000e+4	3.162278e+16	3161.28
1.000000e+5	1.000000e+16	9999.00
1.000000e+6	3.162283e+15	31621.72
1.000000e+7	1.000017e+15	99997.31
1.000000e+8	3.162813e+14	316173.26
1.000000e+9	1.001691e+14	998310.77
1.000000e+10	3.215354e+13	3110076.11
1.000000e+11	1.156937e+13	8643510.55
1.000000e+12	6.621961e+12	15101265.87
1.000000e+13	5.903420e+12	16939332.58
1.000000e+14	5.826694e+12	17162388.81
1.000000e+15	5.818966e+12	17185182.27
1.000000e+16	5.818193e+12	17187466.61
1.000000e+17	5.818115e+12	17187695.10
1.000000e+18	5.818108e+12	17187717.95
1.000000e+19	5.818107e+12	17187720.23


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.