Skip to content

Commit f1772b0

Browse files
committed
Fix equation for refracted rays of non-unit length
Resolves RayTracing#1644
1 parent dc8b773 commit f1772b0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
Change Log / Ray Tracing in One Weekend
22
====================================================================================================
33

4-
# v4.0.2 (2024-10-01)
4+
# v4.0.2 (in progress)
55

66
### Common
77

88
### In One Weekend
9+
- Fix -- Fix equation for refracted rays of non-unit length (#1644)
910

1011
### The Next Week
1112

books/RayTracingInOneWeekend.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3310,7 +3310,7 @@
33103310

33113311
If we solve for $\mathbf{R'}_{\bot}$ and $\mathbf{R'}_{\parallel}$ we get:
33123312

3313-
$$ \mathbf{R'}_{\bot} = \frac{\eta}{\eta'} (\mathbf{R} + \cos\theta \mathbf{n}) $$
3313+
$$ \mathbf{R'}_{\bot} = \frac{\eta}{\eta'} (\mathbf{R} + |\mathbf{R}| \cos(\theta) \mathbf{n}) $$
33143314
$$ \mathbf{R'}_{\parallel} = -\sqrt{1 - |\mathbf{R'}_{\bot}|^2} \mathbf{n} $$
33153315

33163316
You can go ahead and prove this for yourself if you want, but we will treat it as fact and move on.

0 commit comments

Comments
 (0)