Skip to content

Commit 70b1aa9

Browse files
committed
Fix improper bolding of point components
1 parent 845e849 commit 70b1aa9

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,12 @@
386386
--------------
387387
<div class='together'>
388388
The one thing that all ray tracers have is a ray class, and a computation of what color is seen
389-
along a ray. Let’s think of a ray as a function $\mathbf{P}(t) = \mathbf{A} + t \mathbf{b}$. (Note:
390-
throughout these books, we'll use uppercase bold letters for points, and lowercase bold letters for
391-
vectors.) Here $\mathbf{P}$ is a 3D position along a line in 3D. $\mathbf{A}$ is the ray origin and
392-
$\mathbf{b}$ is the ray direction. The ray parameter $t$ is a real number (`double` in the
393-
code). Plug in a different $t$ and $\mathbf{P}(t)$ moves the point along the ray. Add in negative
394-
$t$ and you can go anywhere on the 3D line. For positive $t$, you get only the parts in front of
395-
$\mathbf{A}$, and this is what is often called a half-line or ray.
389+
along a ray. Let’s think of a ray as a function $\mathbf{P}(t) = \mathbf{A} + t \mathbf{b}$. Here
390+
$\mathbf{P}$ is a 3D position along a line in 3D. $\mathbf{A}$ is the ray origin and $\mathbf{b}$ is
391+
the ray direction. The ray parameter $t$ is a real number (`double` in the code). Plug in a
392+
different $t$ and $\mathbf{P}(t)$ moves the point along the ray. Add in negative $t$ and you can go
393+
anywhere on the 3D line. For positive $t$, you get only the parts in front of $\mathbf{A}$, and this
394+
is what is often called a half-line or ray.
396395

397396
![Figure [lerp]: Linear interpolation](../images/fig.lerp.jpg)
398397

@@ -537,19 +536,19 @@
537536
the given point $(x,y,z)$ is _inside_ the sphere, then $x^2 + y^2 + z^2 < R^2$, and if a given point
538537
$(x,y,z)$ is _outside_ the sphere, then $x^2 + y^2 + z^2 > R^2$.
539538

540-
It gets uglier if the sphere center is at $(\mathbf{C}_x, \mathbf{C}_y, \mathbf{C}_z)$:
539+
It gets uglier if the sphere center is at $(C_x, C_y, C_z)$:
541540

542-
$$ (x-\mathbf{C}_x)^2 + (y-\mathbf{C}_y)^2 + (z-\mathbf{C}_z)^2 = r^2 $$
541+
$$ (x - C_x)^2 + (y - C_y)^2 + (z - C_z)^2 = r^2 $$
543542
</div>
544543

545544
<div class='together'>
546545
In graphics, you almost always want your formulas to be in terms of vectors so all the x/y/z stuff
547546
is under the hood in the `vec3` class. You might note that the vector from center
548-
$\mathbf{C} = (\mathbf{C}_x,\mathbf{C}_y,\mathbf{C}_z)$ to point $\mathbf{P} = (x,y,z)$ is
549-
$(\mathbf{P} - \mathbf{C})$, and therefore
547+
$\mathbf{C} = (C_x,C_y,C_z)$ to point $\mathbf{P} = (x,y,z)$ is $(\mathbf{P} - \mathbf{C})$, and
548+
therefore
550549

551550
$$ (\mathbf{P} - \mathbf{C}) \cdot (\mathbf{P} - \mathbf{C})
552-
= (x-\mathbf{C}_x)^2 + (y-\mathbf{C}_y)^2 + (z-\mathbf{C}_z)^2
551+
= (x - C_x)^2 + (y - C_y)^2 + (z - C_z)^2
553552
$$
554553
</div>
555554

@@ -565,7 +564,7 @@
565564
does hit the sphere, there is some $t$ for which $\mathbf{P}(t)$ satisfies the sphere equation. So
566565
we are looking for any $t$ where this is true:
567566

568-
$$ (\mathbf{P}(t) - \mathbf{C})\cdot(\mathbf{P}(t) - \mathbf{C}) = r^2 $$
567+
$$ (\mathbf{P}(t) - \mathbf{C}) \cdot (\mathbf{P}(t) - \mathbf{C}) = r^2 $$
569568

570569
or expanding the full form of the ray $\mathbf{P}(t)$:
571570

0 commit comments

Comments
 (0)