Triangle ABC has vertices A=(0, 1), B=(1, 0) and C=(0, 0) in the coordinate plane.
The insides of the sides are lined with mirrors, and then a laser beam is fired from the origin with a slope of 314/379
Which corner of the triangle will the laser beam hit first?
(In reply to
from a different angle by Steven Lord)
The UBASIC simulation program appears below its output. In the output the coordinates' fractional representation has changed the // of UBASIC to single / for ease of reading. There are 1069 sets of new coordinates at the points of reflection and one set for the destination corner. This agrees with my original post in terms of number of reflections and the final corner reached: (1,0), i.e., point B.
379/693 314/693
65/379 0
0 65/314
83/231 148/231
0 130/379
65/157 0
509/693 184/693
195/379 0
0 195/314
17/99 82/99
0 260/379
130/157 0
71/77 6/77
325/379 0
11/65 54/65
0 368/379
1/63 62/63
0 303/314
303/379 0
617/693 76/693
119/157 0
0 238/379
47/231 184/231
0 173/314
173/379 0
487/693 206/693
54/157 0
0 108/379
271/693 422/693
0 43/314
43/379 0
17/33 16/33
0 22/379
11/157 0
401/693 292/693
87/379 0
0 87/314
227/693 466/693
0 152/379
76/157 0
59/77 18/77
217/379 0
0 217/314
97/693 596/693
0 282/379
141/157 0
661/693 32/693
347/379 0
33/65 32/65
0 346/379
1/21 20/21
0 281/314
281/379 0
85/99 14/99
108/157 0
0 216/379
163/693 530/693
0 151/314
151/379 0
155/231 76/231
43/157 0
0 86/379
293/693 400/693
0 21/314
21/379 0
335/693 358/693
0 44/379
22/157 0
47/77 30/77
109/379 0
0 109/314
205/693 488/693
0 174/379
87/157 0
79/99 20/99
239/379 0
0 239/314
25/231 206/231
0 304/379
152/157 0
683/693 10/693
369/379 0
11/13 2/13
0 324/379
5/63 58/63
0 259/314
259/379 0
191/231 40/231
97/157 0
0 194/379
185/693 508/693
0 129/314
129/379 0
443/693 250/693
32/157 0
0 64/379
5/11 6/11
1/379 0
0 1/314
313/693 380/693
0 66/379
33/157 0
445/693 248/693
131/379 0
0 131/314
61/231 170/231
0 196/379
98/157 0
575/693 118/693
261/379 0
0 261/314
53/693 640/693
0 326/379
53/65 12/65
367/379 0
227/231 4/231
151/157 0
0 302/379
1/9 8/9
0 237/314
237/379 0
551/693 142/693
86/157 0
0 172/379
23/77 54/77
0 107/314
107/379 0
421/693 272/693
21/157 0
0 42/379
337/693 356/693
23/379 0
0 23/314
97/231 134/231
0 88/379
44/157 0
467/693 226/693
153/379 0
0 153/314
23/99 76/99
0 218/379
109/157 0
199/231 32/231
283/379 0
0 283/314
31/693 662/693
0 348/379
31/65 34/65
345/379 0
659/693 34/693
140/157 0
0 280/379
1/7 6/7
0 215/314
215/379 0
529/693 164/693
75/157 0
0 150/379
229/693 464/693
0 85/314
85/379 0
19/33 14/33
10/157 0
0 20/379
359/693 334/693
45/379 0
0 45/314
269/693 424/693
0 110/379
55/157 0
163/231 68/231
175/379 0
0 175/314
139/693 554/693
0 240/379
120/157 0
619/693 74/693
305/379 0
0 305/314
1/77 76/77
0 370/379
9/65 56/65
323/379 0
91/99 8/99
129/157 0
0 258/379
11/63 52/63
0 193/314
193/379 0
169/231 62/231
64/157 0
0 128/379
251/693 442/693
0 63/314
63/379 0
377/693 316/693
0 2/379
1/157 0
127/231 104/231
67/379 0
0 67/314
247/693 446/693
0 132/379
66/157 0
73/99 26/99
197/379 0
0 197/314
13/77 64/77
0 262/379
131/157 0
641/693 52/693
327/379 0
1/5 4/5
0 366/379
13/693 680/693
0 301/314
301/379 0
205/231 26/231
118/157 0
0 236/379
13/63 50/63
0 171/314
171/379 0
485/693 208/693
53/157 0
0 106/379
13/33 20/33
0 41/314
41/379 0
355/693 338/693
0 24/379
12/157 0
403/693 290/693
89/379 0
0 89/314
25/77 52/77
0 154/379
77/157 0
533/693 160/693
219/379 0
0 219/314
95/693 598/693
0 284/379
142/157 0
221/231 10/231
349/379 0
7/13 6/13
0 344/379
5/99 94/99
0 279/314
279/379 0
593/693 100/693
107/157 0
0 214/379
5/21 16/21
0 149/314
149/379 0
463/693 230/693
42/157 0
0 84/379
295/693 398/693
0 19/314
19/379 0
37/77 40/77
0 46/379
23/157 0
425/693 268/693
111/379 0
0 111/314
29/99 70/99
0 176/379
88/157 0
185/231 46/231
241/379 0
0 241/314
73/693 620/693
0 306/379
153/157 0
685/693 8/693
371/379 0
57/65 8/65
0 322/379
19/231 212/231
0 257/314
257/379 0
571/693 122/693
96/157 0
0 192/379
17/63 46/63
0 127/314
127/379 0
7/11 4/11
31/157 0
0 62/379
317/693 376/693
3/379 0
0 3/314
311/693 382/693
0 68/379
34/157 0
149/231 82/231
133/379 0
0 133/314
181/693 512/693
0 198/379
99/157 0
577/693 116/693
263/379 0
0 263/314
17/231 214/231
0 328/379
51/65 14/65
365/379 0
97/99 2/99
150/157 0
0 300/379
79/693 614/693
0 235/314
235/379 0
61/77 16/77
85/157 0
0 170/379
19/63 44/63
0 105/314
105/379 0
419/693 274/693
20/157 0
0 40/379
113/231 118/231
25/379 0
0 25/314
289/693 404/693
0 90/379
45/157 0
67/99 32/99
155/379 0
0 155/314
53/231 178/231
0 220/379
110/157 0
599/693 94/693
285/379 0
0 285/314
29/693 664/693
0 350/379
29/65 36/65
343/379 0
73/77 4/77
139/157 0
0 278/379
101/693 592/693
0 213/314
213/379 0
527/693 166/693
74/157 0
0 148/379
1/3 2/3
0 83/314
83/379 0
397/693 296/693
9/157 0
0 18/379
361/693 332/693
47/379 0
0 47/314
89/231 142/231
0 112/379
56/157 0
491/693 202/693
177/379 0
0 177/314
137/693 556/693
0 242/379
121/157 0
69/77 8/77
307/379 0
0 307/314
1/99 98/99
0 372/379
7/65 58/65
321/379 0
635/693 58/693
128/157 0
0 256/379
41/231 190/231
0 191/314
191/379 0
505/693 188/693
63/157 0
0 126/379
23/63 40/63
0 61/314
61/379 0
125/231 106/231
0 4/379
2/157 0
383/693 310/693
69/379 0
0 69/314
35/99 64/99
0 134/379
67/157 0
57/77 20/77
199/379 0
0 199/314
115/693 578/693
0 264/379
132/157 0
643/693 50/693
329/379 0
3/13 10/13
0 364/379
5/231 226/231
0 299/314
299/379 0
613/693 80/693
117/157 0
0 234/379
145/693 548/693
0 169/314
169/379 0
23/33 10/33
52/157 0
0 104/379
25/63 38/63
0 39/314
39/379 0
353/693 340/693
0 26/379
13/157 0
45/77 32/77
91/379 0
0 91/314
223/693 470/693
0 156/379
78/157 0
535/693 158/693
221/379 0
0 221/314
31/231 200/231
0 286/379
143/157 0
95/99 4/99
351/379 0
37/65 28/65
0 342/379
37/693 656/693
0 277/314
277/379 0
197/231 34/231
106/157 0
0 212/379
167/693 526/693
0 147/314
147/379 0
461/693 232/693
41/157 0
0 82/379
3/7 4/7
0 17/314
17/379 0
331/693 362/693
0 48/379
24/157 0
61/99 38/99
113/379 0
0 113/314
67/231 164/231
0 178/379
89/157 0
557/693 136/693
243/379 0
0 243/314
71/693 622/693
0 308/379
154/157 0
229/231 2/231
373/379 0
59/65 6/65
0 320/379
59/693 634/693
0 255/314
255/379 0
569/693 124/693
95/157 0
0 190/379
3/11 8/11
0 125/314
125/379 0
439/693 254/693
30/157 0
0 60/379
29/63 34/63
5/379 0
0 5/314
103/231 128/231
0 70/379
35/157 0
449/693 244/693
135/379 0
0 135/314
179/693 514/693
0 200/379
100/157 0
193/231 38/231
265/379 0
0 265/314
7/99 92/99
0 330/379
49/65 16/65
363/379 0
677/693 16/693
149/157 0
0 298/379
9/77 68/77
0 233/314
233/379 0
547/693 146/693
84/157 0
0 168/379
211/693 482/693
0 103/314
103/379 0
139/231 92/231
19/157 0
0 38/379
31/63 32/63
27/379 0
0 27/314
41/99 58/99
0 92/379
46/157 0
157/231 74/231
157/379 0
0 1/2
157/693 536/693
0 222/379
111/157 0
601/693 92/693
287/379 0
0 287/314
3/77 74/77
0 352/379
27/65 38/65
341/379 0
655/693 38/693
138/157 0
0 276/379
103/693 590/693
0 211/314
211/379 0
25/33 8/33
73/157 0
0 146/379
233/693 460/693
0 81/314
81/379 0
395/693 298/693
8/157 0
0 16/379
11/21 10/21
49/379 0
0 49/314
265/693 428/693
0 114/379
57/157 0
493/693 200/693
179/379 0
0 179/314
15/77 62/77
0 244/379
122/157 0
89/99 10/99
309/379 0
0 309/314
5/693 688/693
0 374/379
1/13 12/13
319/379 0
211/231 20/231
127/157 0
0 254/379
125/693 568/693
0 189/314
189/379 0
503/693 190/693
62/157 0
0 124/379
85/231 146/231
0 59/314
59/379 0
373/693 320/693
0 6/379
3/157 0
5/9 4/9
71/379 0
0 71/314
27/77 50/77
0 136/379
68/157 0
515/693 178/693
201/379 0
0 201/314
113/693 580/693
0 266/379
133/157 0
215/231 16/231
331/379 0
17/65 48/65
0 362/379
17/693 676/693
0 297/314
297/379 0
611/693 82/693
116/157 0
0 232/379
7/33 26/33
0 167/314
167/379 0
481/693 212/693
51/157 0
0 102/379
277/693 416/693
0 37/314
37/379 0
39/77 38/77
0 28/379
14/157 0
37/63 26/63
93/379 0
0 93/314
221/693 472/693
0 158/379
79/157 0
179/231 52/231
223/379 0
0 223/314
13/99 86/99
0 288/379
144/157 0
667/693 26/693
353/379 0
3/5 2/5
0 340/379
13/231 218/231
0 275/314
275/379 0
589/693 104/693
105/157 0
0 210/379
169/693 524/693
0 145/314
145/379 0
51/77 26/77
40/157 0
0 80/379
299/693 394/693
0 15/314
15/379 0
47/99 52/99
0 50/379
25/157 0
13/21 8/21
115/379 0
0 115/314
199/693 494/693
0 180/379
90/157 0
559/693 134/693
245/379 0
0 245/314
23/231 208/231
0 310/379
155/157 0
689/693 4/693
375/379 0
61/65 4/65
0 318/379
61/693 632/693
0 253/314
253/379 0
9/11 2/11
94/157 0
0 188/379
191/693 502/693
0 123/314
123/379 0
437/693 256/693
29/157 0
0 58/379
107/231 124/231
7/379 0
0 7/314
307/693 386/693
0 72/379
36/157 0
41/63 22/63
137/379 0
0 137/314
59/231 172/231
0 202/379
101/157 0
83/99 16/99
267/379 0
0 267/314
47/693 646/693
0 332/379
47/65 18/65
361/379 0
75/77 2/77
148/157 0
0 296/379
83/693 610/693
0 231/314
231/379 0
545/693 148/693
83/157 0
0 166/379
71/231 160/231
0 101/314
101/379 0
415/693 278/693
18/157 0
0 36/379
49/99 50/99
29/379 0
0 29/314
95/231 136/231
0 94/379
47/157 0
43/63 20/63
159/379 0
0 159/314
155/693 538/693
0 224/379
112/157 0
67/77 10/77
289/379 0
0 289/314
25/693 668/693
0 354/379
5/13 8/13
339/379 0
653/693 40/693
137/157 0
0 274/379
5/33 28/33
0 209/314
209/379 0
523/693 170/693
72/157 0
0 144/379
235/693 458/693
0 79/314
79/379 0
131/231 100/231
7/157 0
0 14/379
365/693 328/693
51/379 0
0 51/314
263/693 430/693
0 116/379
58/157 0
5/7 2/7
181/379 0
0 181/314
19/99 80/99
0 246/379
123/157 0
625/693 68/693
311/379 0
0 311/314
1/231 230/231
0 376/379
3/65 62/65
317/379 0
631/693 62/693
126/157 0
0 252/379
127/693 566/693
0 187/314
187/379 0
167/231 64/231
61/157 0
0 122/379
257/693 436/693
0 57/314
57/379 0
53/99 46/99
0 8/379
4/157 0
43/77 34/77
73/379 0
0 73/314
241/693 452/693
0 138/379
69/157 0
47/63 16/63
203/379 0
0 203/314
37/231 194/231
0 268/379
134/157 0
647/693 46/693
333/379 0
19/65 46/65
0 360/379
19/693 674/693
0 295/314
295/379 0
29/33 4/33
115/157 0
0 230/379
149/693 544/693
0 165/314
165/379 0
479/693 214/693
50/157 0
0 100/379
31/77 46/77
0 35/314
35/379 0
349/693 344/693
0 30/379
15/157 0
409/693 284/693
95/379 0
0 95/314
73/231 158/231
0 160/379
80/157 0
7/9 2/9
225/379 0
0 225/314
89/693 604/693
0 290/379
145/157 0
223/231 8/231
355/379 0
41/65 24/65
0 338/379
41/693 652/693
0 273/314
273/379 0
587/693 106/693
104/157 0
0 208/379
19/77 58/77
0 143/314
143/379 0
457/693 236/693
39/157 0
0 78/379
43/99 56/99
0 13/314
13/379 0
109/231 122/231
0 52/379
26/157 0
431/693 262/693
117/379 0
0 117/314
197/693 496/693
0 182/379
91/157 0
17/21 4/21
247/379 0
0 247/314
67/693 626/693
0 312/379
156/157 0
691/693 2/693
377/379 0
63/65 2/65
0 316/379
1/11 10/11
0 251/314
251/379 0
565/693 128/693
93/157 0
0 186/379
193/693 500/693
0 121/314
121/379 0
145/231 86/231
28/157 0
0 56/379
323/693 370/693
9/379 0
0 9/314
305/693 388/693
0 74/379
37/157 0
151/231 80/231
139/379 0
0 139/314
25/99 74/99
0 204/379
102/157 0
53/63 10/63
269/379 0
0 269/314
5/77 72/77
0 334/379
9/13 4/13
359/379 0
673/693 20/693
147/157 0
0 294/379
85/693 608/693
0 229/314
229/379 0
181/231 50/231
82/157 0
0 164/379
215/693 478/693
0 99/314
99/379 0
59/99 40/99
17/157 0
0 34/379
115/231 116/231
31/379 0
0 31/314
283/693 410/693
0 96/379
48/157 0
475/693 218/693
161/379 0
0 161/314
17/77 60/77
0 226/379
113/157 0
55/63 8/63
291/379 0
0 291/314
23/693 670/693
0 356/379
23/65 42/65
337/379 0
31/33 2/33
136/157 0
0 272/379
107/693 586/693
0 207/314
207/379 0
521/693 172/693
71/157 0
0 142/379
79/231 152/231
0 77/314
77/379 0
391/693 302/693
6/157 0
0 12/379
367/693 326/693
53/379 0
0 53/314
29/77 48/77
0 118/379
59/157 0
71/99 28/99
183/379 0
0 183/314
131/693 562/693
0 248/379
124/157 0
19/21 2/21
313/379 0
0 313/314
1/693 692/693
0 378/379
1/65 64/65
315/379 0
629/693 64/693
125/157 0
0 250/379
43/231 188/231
0 185/314
185/379 0
499/693 194/693
60/157 0
0 120/379
37/99 62/99
0 55/314
55/379 0
41/77 36/77
0 10/379
5/157 0
389/693 304/693
75/379 0
0 75/314
239/693 454/693
0 140/379
70/157 0
173/231 58/231
205/379 0
0 205/314
109/693 584/693
0 270/379
135/157 0
59/63 4/63
335/379 0
21/65 44/65
0 358/379
1/33 32/33
0 293/314
293/379 0
607/693 86/693
114/157 0
0 228/379
151/693 542/693
0 163/314
163/379 0
53/77 24/77
49/157 0
0 98/379
281/693 412/693
0 33/314
33/379 0
347/693 346/693
0 32/379
16/157 0
137/231 94/231
97/379 0
0 97/314
31/99 68/99
0 162/379
81/157 0
541/693 152/693
227/379 0
0 227/314
29/231 202/231
0 292/379
146/157 0
61/63 2/63
357/379 0
43/65 22/65
0 336/379
43/693 650/693
0 271/314
271/379 0
65/77 12/77
103/157 0
0 206/379
173/693 520/693
0 141/314
141/379 0
65/99 34/99
38/157 0
0 76/379
101/231 130/231
0 11/314
11/379 0
325/693 368/693
0 54/379
27/157 0
433/693 260/693
119/379 0
0 119/314
65/231 166/231
0 184/379
92/157 0
563/693 130/693
249/379 0
0 249/314
65/693 628/693
0 314/379
1 0
5 kill "limreflc.txt":open "limreflc.txt" for output as #2
10 dx=379:dy=314
20 repeat
30 m = dy//dx
40 b = y-m*x
50 hypx = (1-b)//(m+1)
60 hypy = m*hypx + b
70 diffx = hypx-x:diffy = hypy-y
80 if sgn(diffx)=sgn(dx) and sgn(diffy)=sgn(dy) and hypx<=1 and hypx>=0 and hypy<=1 and hypy>=0 then
90 :newx=hypx:newy=hypy
100 :newdx=-dy:newdy=-dx
110 :else
120 :if dy<0 then
130 :t=-y//dy
140 :newx=x+dx*t:newy=0:newdy=-dy:newdx=dx
150 :if newx<0 then
160 :t=-x//dx
170 :newy=y+dy*t:newx=0:newdy=dy:newdx=-dx
180 :endif
183 :else
184 :t=-x//dx
185 :newy=y+dy*t:newx=0:newdy=dy:newdx=-dx
190 :endif
200 :endif
210 x=newx:y=newy:dx=newdx:dy=newdy
220 print x,y:print #2, x,y
230 if x<0 or y<0 or y>1-x then print "error":stop
240 if x=0 and y=0 or x=1 and y=0 or x=0 and y=1 then
250 :print "finished":done=1
260 :endif
270 until done
300 close #2
|
Posted by Charlie
on 2019-02-20 12:00:19 |