DECLARE SUB intro () DECLARE SUB betakeus () DECLARE SUB toonklok () DECLARE SUB wisklok () DECLARE SUB tooncoor () DECLARE SUB tekenklok () COMMON SHARED pi, d, dist, distb, yxr, yxh, alfkl, xkl, ykl COMMON SHARED x0, t0, beta, gama, xhh, thh, thv, xhv, xvh, tvh, xvv, tvv COMMON SHARED colh, colv, colvh, colhv COMMON SHARED tith$, titv$ dumx = 15000 colh = 7: colv = 2: colvh = colv: colhv = colh SCREEN 12 intro pi = ATN(1) * 4 'kijkhoogte h0 = 300: 'hoogte reizend voorwerp h = 160: 'window voor h, dist WINDOW (-320, 240)-(320, -240) 'retour- en vertrek- kijkafstanden (distb: x=0; diste: x=x0) diste = 1100: distb = 100: 'schermordinaten retour, vertrek, factor t.o.v. kijkhoogte y0 = 100: y1 = -180: eta = (y0 - y1) / h0 nieuwbeta: '********************************************** 'initialiseer snelheid (beta=v/c), reistijd en afstand(jaar, lichtjaar) '********************************************** betakeus gama = 1 / SQR(1 - beta * beta) 'reis volgens home t0 = 50 'jaar terugkeer; heen+terug= 2*t0 x0 = t0 * beta 'x=0 -> x0 voor d=distb -> dist trh = t0 * (1 + ABS(beta)) 'hometijd wanneer home voyagers retour ziet herhaalbeta: '********************************************** 'herhaal vorige cyclus beta '********************************************** 'init d = 0: x = 0: y = 0 CLS LOCATE 3, 35 COLOR 11 PRINT USING "(v = #.##c)"; beta 'tekenklok '********************************************** '1. standpunt thuisblijver '********************************************** 'correlatie dist <> x: 'dist = distb + INT((diste - distb) * trh / t0) dist = distb + INT((diste - distb) * beta) 'schermordinaat en kijkhoogte voor retourpunt: yxr = y1 + eta * h0 * (dist - distb) / dist hxr = eta * h * distb / dist 'idem voor vertrekpunt: yxh = y1 + 0 hxh = eta * h 'afstand bij retour voor reiziger xr = -x0 / gama 'tekenklok 'titels tith$ = "1: OBSERVATION HOMETWIN" titv$ = "(data acc. to TravTwin)" '********************************************** '1.1. heenreis: '********************************************** colh = 7: colv = 6: colhv = 4: colvh = colv tekenklok 'STEP = afloop proportioneel aan snelheid beta FOR ts = 0 TO trh STEP t0 / diste thh = ts xhh = 0 thv = ts / (1 + ABS(beta)) xhv = beta * thv 'tvv = thh / gama tvv = thv / gama xvv = 0 SELECT CASE thh CASE IS < t0 * (1 - beta * beta) tvh = gama * thh xvh = -beta * tvh colvh = 6 'LOCATE 1, 1: PRINT "1 "; xvh CASE IS < t0 * (1 + beta * beta) tvh = t0 / gama IF thh < t0 THEN bet = SQR(1 - thh / t0) gam = 1 / SQR(1 - bet * bet) xvh = -x0 / gam 'LOCATE 1, 1: PRINT "2a "; xvh ELSE bet = -SQR(-1 + thh / t0) gam = 1 / SQR(1 - bet * bet) xvh = -x0 / gam 'LOCATE 1, 1: PRINT "2b "; xvh END IF colvh = 13 CASE ELSE tvh = -2 * gama * beta * beta * t0 + gama * thh xvh = -beta * (-tvh + 2 * t0 / gama) 'LOCATE 1, 1: PRINT "3 "; xvh colvh = 2 END SELECT 'proportioneel beta d = distb + (dist - distb) * xhv / x0 'schermordinaat yx = y1 + eta * h0 * (d - distb) / d 'kijkhoogte hx = eta * h * distb / d 'twinvoorwerp LINE (-hx / 2, yx)-(hx / 2, yx + hx), colhv, B 'colvh = colv: colhv = colh toonklok tooncoor 'wachtlus proportioneel aan "(kijk-)snelheid" FOR dum = 0 TO dumx: NEXT 'huidige posities wissen: 'twinvoorwerp LINE (-hx / 2, yx)-(hx / 2, yx + hx), 0, B 'vertrek- en retourposities tonen: LINE (-hxh / 2, yxh)-(hxh / 2, yxh + hxh), colh, B wisklok NEXT ts LINE (-hx / 2, yx)-(hx / 2, yx + hx), colv, B 'tooncoor toonklok SLEEP 1 LINE (-hx / 2, yx)-(hx / 2, yx + hx), 0, B '********************************************** '1.2. terugreis: '********************************************** 'disto = d colhv = 1: colv = 2: colvh = colv: colh = 7 FOR ts = trh TO 2 * t0 STEP t0 / diste thh = ts xhh = 0 thv = (ts - 2 * ABS(beta) * t0) / (1 - ABS(beta)) xhv = beta * (2 * t0 - thv) 'tvv = thh / gama tvv = thv / gama xvv = 0 tvh = -2 * gama * beta * beta * t0 + gama * thh xvh = -beta * (-tvh + 2 * t0 / gama) 'LOCATE 1, 1: PRINT "R "; xvh 'proportioneel beta d = distb + (dist - distb) * xhv / x0 yx = y1 + eta * h0 * (d - distb) / d hx = eta * h * distb / d LINE (-hx / 2, yx)-(hx / 2, yx + hx), colhv, B 'colvh = colv: colhv = colh toonklok tooncoor FOR dum = 0 TO dumx: NEXT LINE (-hx / 2, yx)-(hx / 2, yx + hx), 0, B LINE (-hxh / 2, yxh)-(hxh / 2, yxh + hxh), colh, B wisklok NEXT ts 'tooncoor toonklok 'LINE (-hx / 2, yx)-(hx / 2, yx + hx), colh, B SLEEP 3: B$ = INKEY$: IF B$ = " " THEN END 'wisklok '********************************************** '2. standpunt reiziger '********************************************** CLS LOCATE 3, 35 COLOR 11 PRINT USING "(v =-#.##c)"; beta tith$ = "(data acc. to HomeTwin)" titv$ = "2: OBSERVATION TRAVTWIN" '********************************************** '2.1. heenreis: '********************************************** colv = 6: colh = 7: colvh = 4: colhv = colh tekenklok '********************************************** '2.1.1. Tot retourpunt '********************************************** FOR ts = 0 TO t0 / gama STEP t0 / diste tvv = ts xvv = 0 thv = tvv * gama xhv = thv * beta thh = thv * (1 - ABS(beta)) xhh = 0 xvh = gama * (xhh - beta * thh) tvh = gama * (thh - beta * xhh) 'proportioneel beta d = distb + (dist - distb) * ABS(xvh) / (x0 * gama) 'schermordinaat yx = y1 + eta * h0 * .75 * (d - distb) / d 'kijkhoogte hx = eta * h * distb / d 'twinvoorwerp (blijft nu 'ter plaatse'!) LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), colv, B '(thuisvoorwerp 'verwijdert' zich nu!) LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colvh, B 'klokken: 'colvh = colv toonklok tooncoor 'wachtlus proportioneel aan "(kijk-)snelheid" FOR dum = 0 TO dumx: NEXT 'huidige posities wissen: 'twinvoorwerp 'hou rekening met afronding STEP beta LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), 0, B '(home 'verwijdert' zich nu!) LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), 0, B wisklok NEXT ts 'tooncoor toonklok 'onthou yx voor omkeer yxo = yx 'afronding door STEP beta verrekenen 'distvo = d - beta FOR dum = 0 TO dumx: NEXT LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colhv, B LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), colv, B 'colvh = 13: colhv = colvh: 'LOCATE 1, 1: PRINT d: PRINT xvh SLEEP 1 LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), 0, B '********************************************** '2.1.2. instant omkering stelsels in retourpunt '********************************************** 'bet = beta TO -beta => perceptie afstanden = xSvoor -> xSna colv = 13 colvh = colv colhv = colv '1ste: beta TO 0; x'0 TO -x0 (distv TO dist) '********************************************** 'SLEEP FOR bet = beta TO -beta * 1.0001 STEP -beta / 50 gam = 1 / SQR(1 - bet * bet) xhh = 0 thh = t0 * (1 - beta) xhv = x0 thv = t0 tvv = t0 / gama xvv = 0 xvh = gam * beta * t0 * (-1 + bet) ' zie: tvh=... + t'0 tvh = xvh + t0 / gama d = distb + (dist - distb) * ABS(xvh) / (x0 * gama) yx = y1 + eta * h0 * .75 * (d - distb) / d hx = eta * h * distb / d '(thuisvoorwerp ) LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colv, B '(voyager) LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), colvh, B toonklok tooncoor FOR dum = 0 TO dumx: NEXT LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), 0, B LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), 0, B wisklok 'IF bet = beta THEN LOCATE 1, 1: PRINT d: PRINT xvh: SLEEP NEXT bet LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colhv, B LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), colv, B toonklok SLEEP 1 'LOCATE 1, 1: PRINT d: PRINT xvh 'SLEEP wisklok '********************************************** '2.1.3. terugreis: '********************************************** FOR dum = 0 TO dumx: NEXT LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), 0, B colv = 2: colvh = 1: colh = 7: colhv = colh FOR ts = t0 TO 2 * t0 STEP gama * t0 / diste thv = ts xhv = beta * (2 * t0 - thv) thh = thv - ABS(xhv) xhh = 0 xvh = gama * (-x0 + beta * (thh - t0)) ' zie: tvh=... + t'0 tvh = gama * (thh - t0 - beta * beta * t0) + t0 / gama xvv = 0 tvv = thv / gama 'proportioneel beta d = distb + (dist - distb) * ABS(xvh) / (x0 * gama) yx = y1 + eta * h0 * .75 * (d - distb) / d hx = eta * h * distb / d LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), colv, B '(thuisvoorwerp 'nadert' nu!) LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colvh, B 'klokken 'colh = 7: colv = 2 toonklok tooncoor FOR dum = 0 TO dumx: NEXT IF d = distb THEN col = colv ELSE col = 0 LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), col, B LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), col, B 'IF ts = t0 THEN LOCATE 1, 1: PRINT d: PRINT xvh: SLEEP wisklok NEXT ts 'tooncoor toonklok LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colv, B '********************************************** 'volgende cyclus: '********************************************** LOCATE 1, 6: COLOR 11 PRINT "-> PRESS KEY...(SPACE=End, ENTER=New v/c, Other=Repeat)" SLEEP: a$ = INKEY$ IF a$ = " " THEN END wisklok IF a$ = CHR$(13) THEN GOTO nieuwbeta ELSE GOTO herhaalbeta END IF END SUB betakeus CLS : LOCATE 3, 15: COLOR 11 PRINT "RELAtivity SEEn: the TWIN PARADOX" LOCATE 5, 15: COLOR 14 PRINT "Credits: guido wuyts 2006" COLOR 11 'PLAY "l21o3gp21fp21ep21d" LOCATE 8, 1 INPUT " -> velocity beta (=v/c, between +.1 and +.99, 0=END) : ", beta IF beta < .1 OR beta > .99 THEN END ''''EXIT SUB 'CLS 'PLAY "l21o3cp21cp21dp21e" END SUB SUB intro CLS : LOCATE 3, 15: COLOR 11 PRINT "RELAtivity SEEn: the TWIN PARADOX" LOCATE 5, 15: COLOR 14 PRINT "Credits: guido wuyts 2006" COLOR 2 PRINT " 1/2" PRINT " This 'TwinSee Simulator' shows how the Paradox Twins would actually" PRINT " SEE each other during the 'forth' and 'back' trips of the traveler," PRINT " taking into account the retardation of the light signals," PRINT " including the Doppler red and blue shifts," PRINT " and displaying the instantaneous transition effects" PRINT " experienced by the traveling twin at his return point" PRINT " (limit case of continuous de- and accelerated return!)." PRINT PRINT " The two standpoints are shown: " PRINT " 1. Observation by HomeTwin (and corresponding data TravTwin)" PRINT " 2. Observation by TravTwin (and corresponding data HomeTwin)" PRINT " HomeTwin shown as the lower square; TravTwin shown as the upper square. " PRINT " Data shown: clocks of/by either twin, and distance bar;" PRINT " left side: HomeTwin's data, right side:TravTwin's data." PRINT PRINT " Colors:" PRINT " HomeTwin white; TravTwin orange at forth trip, green at back trip;" PRINT " magenta during 'instant' turning back (also data HomeTwin)." PRINT " Red shift at recession, and blue shift at approach are shown upon" PRINT " the observed twin and upon his observing kin's data." LOCATE 28, 1 COLOR 11 PRINT " > PRESS KEY..." SLEEP a$ = INKEY$ 'PLAY "l21o3gp21fp21ep21d" CLS : LOCATE 3, 15: COLOR 11 PRINT "RELAtivity SEEn: the TWIN PARADOX" LOCATE 5, 15: COLOR 14 PRINT "Credits: guido wuyts 2006" COLOR 2 PRINT " 2/2" PRINT " Travel time according to HomeTwin is set to 100 Ys (years): " PRINT " 50 years forth and 50 back, so either velocity is equal (+v and -v)." PRINT " Distance reached according to HomeTwin = 50*v/c LYs (lightyears)." PRINT PRINT " Notice the longer, lower-velocity forth trip, and the shorter," PRINT " higher-velocity back trip, as seen by the HomeTwin." PRINT " Notice the equal duration of seeing for the TravTwin," PRINT " but the dramatic shift in distance and time 'seen' during his" PRINT " instant return, and the corresponding lower-velocity recession," PRINT " and higher-velocity approach of his homebody." PRINT PRINT " -> Choose velocity v, or rather, beta=v/c..." PRINT " " LOCATE 28, 1 COLOR 11 PRINT " > PRESS KEY..." SLEEP a$ = INKEY$ 'PLAY "l21o3gp21fp21ep21d" END SUB SUB tekenklok 'wijzerplaten' 'klokken van thuisblijver 'klok voor retourpunt: CIRCLE (-200, yxr), 40, 7, 0, pi '''colh, 0, pi 'klok voor vertrekpunt: CIRCLE (-200, yxh), 40, 7, 0, pi '''colhv, 0, pi hoek = .5 * pi * beta * beta CIRCLE (-200, yxh), 40, 13, .5 * pi - hoek, .5 * pi + hoek 'klokken van reiziger 'klok voor retourpunt: CIRCLE (200, yxr), 40, 6, 0, .5 * pi / gama CIRCLE (200, yxr), 40, 2, .5 * pi / gama, pi / gama 'klok voor vertrekpunt: CIRCLE (200, yxh), 40, 6, 0, .5 * pi / gama CIRCLE (200, yxh), 40, 2, .5 * pi / gama, pi / gama END SUB SUB tooncoor COLOR colhv LOCATE 7, 8 PRINT USING "t trav:####.# Ys"; thv LOCATE 20, 8 PRINT USING "< dist:####.# LYs"; xhv COLOR colh LOCATE 3, 6 PRINT tith$ '"Observation HomeTwin" LOCATE 23, 8 PRINT USING "t home:####.# Ys"; thh COLOR colv LOCATE 3, 55 PRINT titv$ '"Observation TravTwin" LOCATE 7, 55 PRINT USING " t'trav:####.# Ys"; tvv COLOR colvh LOCATE 23, 55 PRINT USING " t'home:####.# Ys"; tvh LOCATE 20, 55 PRINT USING " dist': ####.# LYs>"; xvh END SUB SUB toonklok 'wijzers' 'voyager volgens home 'wijzerhoek 'alfkl = d * pi * .5 / dist alfkl = thv * pi * .5 / t0 'wijzer-x en -y xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) 'wijzers: LINE (-200, yxr)-(-200 + xkl, yxr + ykl), colh PSET (-200 + xkl * 1.1, yxr + ykl * 1.1), colhv 'home volgens home alfkl = thh * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (-200, yxh)-(-200 + xkl, yxh + ykl), colh PSET (-200 + xkl * 1.1, yxh + ykl * 1.1), colhv 'voyager volgens voyager alfkl = tvv * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (200, yxr)-(200 + xkl, yxr + ykl), colv PSET (200 + xkl * 1.1, yxr + ykl * 1.1), colvh 'home volgens voyager alfkl = tvh * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (200, yxh)-(200 + xkl, yxh + ykl), colv SELECT CASE colvh CASE 4: r = 1.1 CASE 13: r = 1.2 CASE 1: r = 1.33 CASE ELSE: r = 1.1 END SELECT PSET (200 + xkl * r, yxh + ykl * r), colvh 'afstand volgens home LINE (-280, yxh)-(-280, yxh + (ABS(xhv) / x0) * (yxr - yxh)), colhv LINE -(-280, yxr), 0 'afstand volgens voyager yxx = yxh + (ABS(xvh) / x0) * (yxr - yxh) 'controle wanneer > "x0 hetzij yxr-yxh" IF yxx > yxr AND yxx > yxxo THEN yxxo = yxx 'teken afstand LINE (280, yxh)-(280, yxx), colvh 'clear daarbuiten IF yxxo > yxr THEN LINE -(280, yxxo), 0 ELSE LINE -(280, yxr), 0 END SUB SUB wisklok 'LINE (-200, yxr)-(-200 + xkl, yxr + ykl), 0 'LINE (-200, yxh)-(-200 + xkl, yxh + ykl), 0 'LINE (200, yxr)-(200 + xkl, yxr + ykl), 0 'LINE (200, yxh)-(200 + xkl, yxh + ykl), 0 'voyager volgens home 'wijzerhoek 'alfkl = d * pi * .5 / dist alfkl = thv * pi * .5 / t0 'wijzer-x en -y xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) 'wijzers: LINE (-200, yxr)-(-200 + xkl, yxr + ykl), 0 'home volgens home alfkl = thh * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (-200, yxh)-(-200 + xkl, yxh + ykl), 0 'voyager volgens voyager alfkl = tvv * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (200, yxr)-(200 + xkl, yxr + ykl), 0 'home volgens voyager alfkl = tvh * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (200, yxh)-(200 + xkl, yxh + ykl), 0 ''afstand volgens home 'LINE (-280, yxh)-(-280, yxh + (ABS(xhv) / x0) * (yxr - yxh)), 0 ''afstand volgen voyager 'LINE (280, yxh)-(280, yxh + (ABS(xvh) / x0) * (yxr - yxh)), 0 END SUB