{ ==================================================================== calc_delay.f (C) 21-Feb-2005 globalchimes at yahoo dot ca ==================================================================== } marker calc_delay 1087467 constant sound_speed_feet_per_1000s \ speed of sound in feet per 1000 seconds 983571056 constant light_speed_feet_per_s \ speed of light in feet per second 1862824 constant light_speed_miles_per_10s \ speed of light in miles per 10 seconds 25000 constant earth_circumference_miles \ circumference of earth in miles 134204 constant radio_wave_delay_whole_earth_us \ time to circumnavigate globe in microseconds 67102 constant radio_wave_delay_half_earth_us \ radio delay between observers on opposite sides of the globe 5280 constant feet_per_mile \ definition of statute mile 1349 constant Toronto_WWVB_miles \ distance from Toronto to Boulder Colorado : (radio_delay) ( miles -- microseconds ) dpl @ 0< if 10000000 light_speed_miles_per_10s */ else dpl @ 0 = if 10000000 light_speed_miles_per_10s m*/ d>s else dpl @ 1 = if 1000000 light_speed_miles_per_10s m*/ d>s else dpl @ 2 = if 100000 light_speed_miles_per_10s m*/ d>s else cr ." Please enter WHOLE miles with ONE or TWO decimal places only." throw then then then then ; : (sound_delay) ( feet -- microseconds ) dpl @ 0< if 1000000000 sound_speed_feet_per_1000s */ else dpl @ 0 = if 1000000000 sound_speed_feet_per_1000s m*/ d>s else dpl @ 1 = if 100000000 sound_speed_feet_per_1000s m*/ d>s else dpl @ 2 = if 10000000 sound_speed_feet_per_1000s m*/ d>s else cr ." Please enter WHOLE feet with ONE or TWO decimal places only." throw then then then then ; : .radio_delay depth 0= if cr ." Usage: 1234.56 .radio_delay " cr exit then (radio_delay) cr . ." microseconds " cr ; : .sound_delay depth 0= if cr ." Usage: 12.34 .sound_delay " cr exit then (sound_delay) cr . ." microseconds " cr ; : print_radio_delay depth 0= if cr ." Usage: 1234.56 print_radio_delay " cr exit then .radio_delay ; : print_sound_delay depth 0= if cr ." Usage: 12.34 print_sound_delay " cr exit then .sound_delay ;