-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
665 lines (623 loc) · 27.1 KB
/
index.html
File metadata and controls
665 lines (623 loc) · 27.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>波動光学回折</title>
<link rel="stylesheet" href="style.css" />
<script
id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js"
></script>
<script>
window.MathJax = {
tex: {
inlineMath: [
["$", "$"],
["\\(", "\\)"],
],
displayMath: [
["$$", "$$"],
["\\[", "\\]"],
],
},
};
</script>
</head>
<body>
<div class="container">
<header>
<h1>波動光学回折</h1>
<p><em>任意開口による干渉パターンのリアルタイム演算</em></p>
</header>
<main class="paper-content">
<!-- Interactive Simulation Section -->
<section class="simulation-section">
<h2>インタラクティブシミュレーション</h2>
<p>
以下のシミュレーターを使用して、任意の開口形状における光の回折パターンをリアルタイムで観察できます。物理的に正確な色再現により、実際の光学現象を直感的に理解することができます。
</p>
<div class="app-layout">
<!-- Parameters Panel -->
<section class="controls-panel">
<h3 style="margin-top: 0">シミュレーション設定</h3>
<div class="parameter-group">
<h4>光源設定</h4>
<label>
光源タイプ:
<select id="light-source-type">
<option value="point">点光源</option>
<option value="plane">平面波</option>
</select>
</label>
<div id="point-source-params" class="param-subset">
<label>
光源距離 (z₁): <span id="source-distance-value">1.0</span>m
<input
type="range"
id="source-distance"
value="1.0"
min="0.1"
max="10.0"
step="0.1"
class="param-slider"
/>
</label>
</div>
<div
id="plane-source-params"
class="param-subset"
style="display: none"
>
<label>
入射角 θₓ: <span id="incident-angle-x-value">0.00</span>rad
<input
type="range"
id="incident-angle-x"
value="0"
min="-0.5"
max="0.5"
step="0.01"
class="param-slider"
/>
</label>
<label>
入射角 θᵧ: <span id="incident-angle-y-value">0.00</span>rad
<input
type="range"
id="incident-angle-y"
value="0"
min="-0.5"
max="0.5"
step="0.01"
class="param-slider"
/>
</label>
</div>
</div>
<div class="parameter-group">
<h4>波長設定</h4>
<label>
波長モード:
<select id="wavelength-mode">
<option value="single">単色光</option>
<option value="multi">多色光</option>
</select>
</label>
<div id="single-wavelength-params" class="param-subset">
<label>
波長: <span id="wavelength-value">550</span>nm
<input
type="range"
id="wavelength"
value="550"
min="380"
max="780"
step="5"
class="param-slider wavelength-slider"
/>
</label>
</div>
<div
id="multi-wavelength-params"
class="param-subset"
style="display: none"
>
<label>
最小波長: <span id="wavelength-min-value">400</span>nm
<input
type="range"
id="wavelength-min"
value="400"
min="380"
max="780"
step="10"
class="param-slider wavelength-slider"
/>
</label>
<label>
最大波長: <span id="wavelength-max-value">700</span>nm
<input
type="range"
id="wavelength-max"
value="700"
min="380"
max="780"
step="10"
class="param-slider wavelength-slider"
/>
</label>
<label>
サンプル数: <span id="wavelength-samples-value">8</span>
<input
type="range"
id="wavelength-samples"
value="8"
min="3"
max="15"
step="1"
class="param-slider"
/>
</label>
</div>
</div>
<div class="parameter-group">
<h4>幾何学設定</h4>
<label>
開口-スクリーン距離 (z₂):
<span id="screen-distance-value">2.0</span>m
<input
type="range"
id="screen-distance"
value="2.0"
min="0.1"
max="10.0"
step="0.1"
class="param-slider"
/>
</label>
<label>
開口サイズ: <span id="aperture-size-value">10.0</span>mm
<input
type="range"
id="aperture-size"
value="10.0"
min="0.1"
max="50.0"
step="0.1"
class="param-slider"
data-unit="mm"
data-factor="0.001"
/>
</label>
<label>
スクリーンサイズ: <span id="screen-size-value">50</span>mm
<input
type="range"
id="screen-size"
value="50"
min="5"
max="200"
step="5"
class="param-slider"
data-unit="mm"
data-factor="0.001"
/>
</label>
</div>
<div class="parameter-group">
<h4>計算設定</h4>
<label>
ゼロパディング係数:
<input
type="number"
id="zero-padding"
value="2"
min="1"
max="4"
step="1"
/>
</label>
</div>
<div class="parameter-group">
<h4>描画設定</h4>
<label>
ブラシサイズ:
<input
type="range"
id="brush-size"
min="1"
max="50"
value="10"
/>
<span id="brush-size-value">10</span>px
</label>
<label>
不透明度:
<input
type="range"
id="brush-opacity"
min="0"
max="100"
value="100"
/>
<span id="brush-opacity-value">100</span>%
</label>
<div class="brush-actions">
<button id="clear-aperture">クリア</button>
<button id="preset-single-slit">単スリット</button>
<button id="preset-double-slit">複スリット</button>
<button id="preset-circular">円形開口</button>
</div>
</div>
<div class="action-buttons">
<button id="reset-params">リセット</button>
<div class="realtime-status">
<span id="realtime-indicator" class="status-indicator"
>●</span
>
リアルタイム演算
</div>
</div>
</section>
<!-- Canvas Display Area -->
<section class="canvas-area">
<div class="canvas-container">
<div class="canvas-wrapper">
<h4>開口関数 T(x,y)</h4>
<canvas
id="aperture-canvas"
width="512"
height="512"
></canvas>
<div class="canvas-info">
<span>左クリック: 描画 | 右クリック: 消去</span>
</div>
</div>
<div class="canvas-wrapper">
<h4>回折パターン |U_S(X,Y)|²</h4>
<canvas id="screen-canvas" width="512" height="512"></canvas>
<div class="canvas-info">
<span id="calculation-status">計算準備完了...</span>
</div>
</div>
</div>
<div class="geometry-diagram">
<div class="diagram-container">
<div class="number-line">
<div class="line-background"></div>
<div
class="position-marker source-marker"
id="source-marker"
>
<div class="marker-point"></div>
<div class="marker-label">光源</div>
<div class="distance-label" id="source-distance-label">
1.0m
</div>
</div>
<div
class="position-marker aperture-marker"
id="aperture-marker"
>
<div class="marker-point"></div>
<div class="marker-label">開口</div>
<div class="distance-label">0m</div>
</div>
<div
class="position-marker screen-marker"
id="screen-marker"
>
<div class="marker-point"></div>
<div class="marker-label">スクリーン</div>
<div class="distance-label" id="screen-distance-label">
2.0m
</div>
</div>
</div>
<div class="total-distance">
<span>総距離: </span>
<span id="total-distance-label">3.0m</span>
</div>
</div>
</div>
<div class="result-info">
<h4>計算結果</h4>
<div class="info-grid">
<div class="info-item">
<label>計算時間:</label>
<span id="calculation-time">-</span>
</div>
<div class="info-item">
<label>フレネル数:</label>
<span id="fresnel-number">-</span>
</div>
<div class="info-item">
<label>回折限界:</label>
<span id="diffraction-limit">-</span>
</div>
<div class="info-item">
<label>メモリ使用量:</label>
<span id="memory-usage">-</span>
</div>
</div>
</div>
</section>
</div>
</section>
<!-- About This Simulator -->
<section class="about">
<h2>このシミュレーターについて</h2>
<p>
この波動光学シミュレーターは、任意の形状の開口を通過する光の回折現象をリアルタイムで計算・可視化するツールです。WebGLによるGPU並列計算を活用し、厳密な波動伝播アルゴリズムを実装しています。
</p>
<p>
光は波としての性質を持ち、障害物や開口の周りで曲がる (回折)
現象を示します。この複雑な物理現象を、マウスで描いた任意の開口形状に対してリアルタイムで計算し、実際の光学実験と同様の結果を得ることができます。
</p>
<p>
教育目的での光学現象の理解促進から、計算光学研究での活用まで、幅広い用途に対応しています。物理的に正確な色再現により、単色光から多色光まで対応し、実際の光学現象を忠実に再現します。
</p>
</section>
<!-- Mathematical Model -->
<section class="theory">
<h2>数学的モデル</h2>
<h3>入射波場</h3>
<p>開口面における入射波場は光源の設定により決定されます:</p>
<p><strong>点光源: </strong>距離$z_1$から発生する球面波の場合:</p>
$$U_0(x,y) =
\frac{e^{ik\sqrt{(x-x_s)^2+(y-y_s)^2+z_1^2}}}{\sqrt{(x-x_s)^2+(y-y_s)^2+z_1^2}}$$
<p>
<strong>平面波: </strong>入射角$(\theta_x,
\theta_y)$を持つコリメート光の場合:
</p>
$$U_0(x,y) = e^{ik(x\sin\theta_x + y\sin\theta_y)}$$
<p>ここで$k = 2\pi/\lambda$は波数です。</p>
<h3>開口透過</h3>
<p>開口透過後の複素振幅は次式で表されます:</p>
$$U_A(x,y) = T(x,y) \cdot U_0(x,y)$$
<p>
ここで$T(x,y) \in
[0,1]$は、ユーザーが描いた開口パターンから導出される振幅透過関数です。
</p>
<h3>波動伝播計算法</h3>
<p>
<strong>Fresnel-Kirchhoff 回折:</strong
>任意の伝播距離に対する最も一般的な定式化:
</p>
$$U_S(X,Y) = \frac{e^{ikz_2}}{i\lambda z_2}
e^{\frac{ik}{2z_2}(X^2+Y^2)} \iint U_A(x,y)
e^{\frac{ik}{2z_2}(x^2+y^2)} e^{-\frac{ik}{z_2}(xX+yY)} dx\,dy$$
<p>
<strong>Angular Spectrum 法:</strong
>フーリエ変換を用いた最も計算効率の高いアプローチ:
</p>
$$\begin{aligned} \tilde{U}_A(k_x,k_y) &= \mathcal{F}\{U_A(x,y)\} \\
\tilde{U}_S(k_x,k_y) &= \tilde{U}_A(k_x,k_y) \cdot
e^{iz_2\sqrt{k^2-k_x^2-k_y^2}} \\ U_S(X,Y) &=
\mathcal{F}^{-1}\{\tilde{U}_S(k_x,k_y)\} \end{aligned}$$
</section>
<!-- Numerical Implementation -->
<section class="implementation">
<h2>数値実装</h2>
<h3>離散フーリエ変換</h3>
<p>
すべての伝播計算は、WebGLシェーダーでGPU上で実行される2D高速フーリエ変換
(FFT)
アルゴリズムを使用して実装されています。離散サンプリングはナイキスト基準の注意深い考慮が必要です:
</p>
$$\Delta x \leq \frac{\lambda z_2}{N_x \Delta x_s}$$
<p>ここで$N_x$はサンプリング点数、$\Delta x_s$は観測面の間隔です。</p>
<h3>ゼロパディングと数値安定性</h3>
<p>
端部回折によるエイリアシング効果を防止するため、設定可能なオーバーサンプリング比でゼロパディングが適用されます。実装では、因数分解位相乗算を通じて高精度浮動小数点演算での位相巻き返しの問題を処理しています。
</p>
<h3>多波長計算</h3>
<p>
多色光照明の場合、システムは各波長$\lambda_i$に対して独立して回折パターンを計算し、スペクトラム積分を通じて結果を結合します。
</p>
</section>
<!-- Color Space Conversion -->
<section class="color-conversion">
<h2>色空間変換</h2>
<p>
物理的に正確な色再現は、CIE
1931標準観測者等色関数を通じて実現されます。スペクトラムパワー分布はXYZ座標に変換されます:
</p>
$$\begin{aligned} X &= \sum_i w_i I(\lambda_i) \bar{x}(\lambda_i)
\Delta\lambda \\ Y &= \sum_i w_i I(\lambda_i) \bar{y}(\lambda_i)
\Delta\lambda \\ Z &= \sum_i w_i I(\lambda_i) \bar{z}(\lambda_i)
\Delta\lambda \end{aligned}$$
<p>
ここで$I(\lambda_i) =
|U_S(\lambda_i)|^2$は波長$\lambda_i$における強度、$\bar{x}$、$\bar{y}$、$\bar{z}$はCIE等色関数です。
</p>
<p>
XYZ値は標準変換マトリックスとディスプレイ用ガンマ補正を用いてsRGB色空間に変換されます。
</p>
</section>
<!-- References Section -->
<section class="references">
<h2>参考文献</h2>
<ol>
<li>
Goodman, <em>Introduction to Fourier Optics</em>.
フレネル/フラウンホーファ回折、角スペクトル、伝達関数、FFT実装の理論的土台。アパーチャ面→観測面の二次位相補正付きFTとしてのフレネル積分など、本実装の柱。
(<a
href="https://www.macmillanlearning.com/college/us/product/Introduction-to-Fourier-Optics/p/1319119166"
>macmillanlearning.com</a
>,
<a
href="https://books.google.com/books/about/Introduction_to_Fourier_Optics.html?id=ow5xs_Rtt9AC"
>Google Books</a
>)
</li>
<li>
Born & Wolf, <em>Principles of Optics</em>.
レイリー-ゾンマーフェルト積分、フレネル-キルヒホッフ近似の厳密な扱い。近接場
~ 遠方場の前提条件整理に。 (<a
href="https://books.google.com/books/about/Principles_of_Optics.html?id=HY-GDAAAQBAJ"
>Google Books</a
>,
<a
href="https://catdir.loc.gov/catdir/samples/cam041/98049429.pdf"
>catdir.loc.gov</a
>)
</li>
<li>
Saleh & Teich, <em>Fundamentals of Photonics</em> (3rd ed.).
フーリエ光学と回折 (Talbot効果など)
を一巻に体系化。Goodmanと相互参照に便利。 (<a
href="https://lib.ysu.am/disciplines_bk/1e50d8144d6e0c3ffea3ae655684c626.pdf"
>YSU Library</a
>)
</li>
<li>
Edinburgh 大学講義ノート: Scalar Diffraction.
レイリー-ゾンマーフェルト→キルヒホッフ→フレネルの導出がコンパクト。式の仮定が追いやすい。
(<a
href="https://www2.ph.ed.ac.uk/~wjh/teaching/mo/slides/scalar/scalar.pdf"
>School of Physics and Astronomy</a
>)
</li>
<li>
ETH 講義ノート: Angular Spectrum Representation.
角スペクトル法の平面波分解・エバネッセント成分の扱いを整理。GPU実装時のカットオフの根拠に。
(<a
href="https://ethz.ch/content/dam/ethz/special-interest/itet/photonics-dam/documents/lectures/EandM/AngularSpectrumRepresentation.pdf"
>ETH Zürich</a
>)
</li>
<li>
MIT OCW 2.71: Fraunhofer & Fresnel.
フーリエ変換としての遠方回折、二次位相を含む近似の見通し。実装のスケーリング感覚を掴むのに良い。
(<a
href="https://ocw.mit.edu/courses/2-71-optics-spring-2009/resources/lecture-17-fraunhofer-diffraction-fourier-transforms-and-theorems/"
>MIT OpenCourseWare</a
>)
</li>
<li>
Matsushima (Optics Express 2009): Band-Limited Angular Spectrum
(BLAS).
角スペクトル法のサンプリング問題を緩和するバンド制限版。短~中距離の数値安定性向上に有効。
(<a href="https://opg.optica.org/abstract.cfm?uri=oe-17-22-19662"
>Optica Publishing Group</a
>,
<a
href="https://kansai-u.repo.nii.ac.jp/record/11127/files/KU-1100-20091015-50.pdf"
>関西大学学術リポジトリ</a
>, <a href="https://pubmed.ncbi.nlm.nih.gov/19997186/">PubMed</a>)
</li>
<li>
Shimobaba ほか (arXiv 2013): ARSS-Fresnel (別解: Bluestein/CZT
同値性に言及).
ずれ・拡大縮小を伴うフレネル計算のエイリアシング条件を解析し、帯域制限で改善。スケール変更UIを想定する実装に直結。
(<a href="https://arxiv.org/pdf/1304.1203">arXiv</a>,
<a href="https://ar5iv.labs.arxiv.org/html/1304.1203">ar5iv</a>)
</li>
<li>
Shimobaba (Optics Letters 2012): Scaled Angular Spectrum.
角スペクトルで入出力サンプリングを変える手法。ズーム表示や異解像度キャンバス間の伝搬に。
(<a href="https://opg.optica.org/abstract.cfm?uri=ol-37-19-4128"
>Optica Publishing Group</a
>)
</li>
<li>
Zhang ほか (JOSA A 2020): 数値回折法の統一的比較.
単一FFT型フレネル/伝達関数法/インパルス応答法/角スペクトル/Rayleigh-Sommerfeld
を位相空間と標本化の観点で比較。方法選択の設計指針として有用。 (<a
href="https://opg.optica.org/josaa/upcoming_pdf.cfm?id=401908"
>Optica Publishing Group</a
>)
</li>
<li>
Mas ほか (1999) FFT 回折の高速アルゴリズム. D-FFT
をフレネル計算へ写像する際のサンプリング条件と計算利点。古典だが今も参考になる。
(<a
href="https://citeseerx.ist.psu.edu/document?doi=50f9885dd1aa88509da84b47ac87529b3d792cad&repid=rep1&type=pdf"
>CiteSeerX</a
>)
</li>
<li>
Hu ほか (Light: Sci & Appl. 2020) Bluestein
法でのスカラー/ベクトル回折.
距離・倍率の自由度、数値効率の両立。WebGL
でのスケーラブルなズーム伝搬設計の根拠に。 (<a
href="https://www.nature.com/articles/s41377-020-00362-z"
>Nature</a
>,
<a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC7801469/">PMC</a
>)
</li>
<li>
最新応用レビュー/実装例 (MDPI 2019-2025 など). CZT
を用いた拡大縮小や三次元CGHへの適用など、実装上の "逃げ道"
を多数紹介。設計の発散防止に。 (<a
href="https://www.mdpi.com/2076-3417/9/10/2118"
>MDPI</a
>,
<a
href="https://www.sciencedirect.com/science/article/pii/S0030399223003845"
>サイエンスダイレクト</a
>,
<a
href="https://pubs.aip.org/aip/pop/article-pdf/doi/10.1063/5.0250718/20466023/043901_1_5.0250718.pdf"
>AIP Publishing</a
>)
</li>
<li>
CIE公式: 1931 等色関数 (2°標準観測者) データセット. XYZ への離散和
(∑ I(λ)x̄(λ)Δλ など) で使う正本データ。GPU では 1D
テクスチャ化が実務的。 (<a
href="https://cie.co.at/datatable/cie-1931-colour-matching-functions-2-degree-observer"
>cie.co.at</a
>)
</li>
<li>
W3C CSS Color 4 (2025 CRD). sRGB の行列 (XYZ↔線形sRGB)
とトーンカーブ (2.4/12.92 の分岐)
をサンプルコード込みで規定。Web実装の参照規格として最適。 (<a
href="https://www.w3.org/TR/css-color-4/"
>W3C</a
>)
</li>
<li>
Wyman/Sloan/Shirley (JCGT 2013). CIE XYZ
等色関数の解析近似式。λ連続サンプリングを軽量化したい場合の代替
(ただし最終色合わせはCIE表と比較検証推奨)。 (<a
href="https://jcgt.org/published/0002/02/01/"
>jcgt.org</a
>)
</li>
<li>
W3C "sRGB" 概説ページ. sRGB の来歴と規格位置づけ (IEC 61966-2-1
を参照)。標準白点 D65 前提などの周辺知識に。 (<a
href="https://www.w3.org/Graphics/Color/sRGB.html"
>W3C</a
>)
</li>
<li>
MIT 8.03SC: 干渉・回折の章 (二重スリットなど). 解析式 (sincxcos²
形) で数値像の妥当性をチェックする際の "基準パターン"
として使える。 (<a
href="https://ocw.mit.edu/courses/8-03sc-physics-iii-vibrations-and-waves-fall-2016/79c0663b6fc5d0a84a9f453e292ae121_MIT8_03SCF16_Text_Ch13.pdf"
>MIT OpenCourseWare</a
>)
</li>
</ol>
</section>
</main>
<footer>
<p>© t3tra 2025, All Rights Reserved.</p>
</footer>
</div>
<!-- JavaScript libraries -->
<script src="webgl-utils.js"></script>
<script src="shader-loader.js"></script>
<script src="fft.js"></script>
<script src="color-conversion.js"></script>
<script src="waveoptics.js"></script>
<script src="main.js"></script>
</body>
</html>