Skip to content

Commit 4350083

Browse files
authored
Fix rtweekend h intro
Missed updates for book 1.
1 parent cb52be7 commit 4350083

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,9 +1390,8 @@
13901390
---------------------------------------
13911391
We need some math constants that we conveniently define in their own header file. For now we only
13921392
need infinity, but we will also throw our own definition of pi in there, which we will need later.
1393-
There is no standard portable definition of pi, so we just define our own constant for it. We'll
1394-
also throw common useful constants and future utility functions in `rtweekend.h`, our general main
1395-
header file.
1393+
We'll also throw common useful constants and future utility functions in here. This new header,
1394+
`rtweekend.h`, will be our general main header file.
13961395

13971396
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
13981397
#ifndef RTWEEKEND_H
@@ -1432,20 +1431,24 @@
14321431
[Listing [rtweekend-initial]: <kbd>[rtweekend.h]</kbd> The rtweekend.h common header]
14331432

14341433
All main program files will include `rtweekend.h` first, so most other header files (where the bulk
1435-
of our code will reside) can assume that these definitions are already available. (Headers included
1436-
inside `rtweekend.h` still need to include any of their dependencies.) We'll make some updates with
1437-
this assumption in mind.
1434+
of our code will reside) can assume these definitions are already available. Headers included inside
1435+
`rtweekend.h` still need to include any of their dependencies. We'll make some updates with this
1436+
assumption in mind.
14381437

14391438
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ delete
1439+
#include "vec3.h"
1440+
14401441
#include <iostream>
14411442
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1442-
[Listing [assume-rtw-color]: <kbd>[color.h]</kbd> Assume rtweekend.h in color.h]
1443+
[Listing [assume-rtw-color]: <kbd>[color.h]</kbd> Assume rtweekend.h inclusion for color.h]
14431444

14441445

14451446
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ delete
14461447
#include "ray.h"
14471448
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1448-
[Listing [assume-rtw-hittable]: <kbd>[hittable.h]</kbd> Assume rtweekend.h in hittable.h]
1449+
[Listing [assume-rtw-hittable]: <kbd>[hittable.h]</kbd>
1450+
Assume rtweekend.h inclusion for hittable.h
1451+
]
14491452

14501453

14511454
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ delete
@@ -1459,14 +1462,14 @@
14591462
using std::shared_ptr;
14601463
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14611464
[Listing [assume-rtw-hittable-list]: <kbd>[hittable_list.h]</kbd>
1462-
Assume rtweekend.h in hittable_list.h
1465+
Assume rtweekend.h inclusion for hittable_list.h
14631466
]
14641467

14651468

14661469
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ delete
14671470
#include "vec3.h"
14681471
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1469-
[Listing [assume-rtw-sphere]: <kbd>[sphere.h]</kbd> Assume rtweekend.h in sphere.h]
1472+
[Listing [assume-rtw-sphere]: <kbd>[sphere.h]</kbd> Assume rtweekend.h inclusion for sphere.h]
14701473

14711474

14721475
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ delete
@@ -1475,7 +1478,7 @@
14751478

14761479
using std::sqrt;
14771480
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1478-
[Listing [assume-rtw-vec3]: <kbd>[vec3.h]</kbd> Assume rtweekend.h in vec3.h]
1481+
[Listing [assume-rtw-vec3]: <kbd>[vec3.h]</kbd> Assume rtweekend.h inclusion for vec3.h]
14791482

14801483
<div class='together'>
14811484
And now the new main:
@@ -2944,8 +2947,8 @@
29442947
In service of this, we'll create a new vector method -- `vec3::near_zero()` -- that returns true if
29452948
the vector is very close to zero in all dimensions.
29462949

2947-
We'll need to use the C++ standard library function `std::fabs`, which returns the absolute value of
2948-
its input. We'll add this to `rtweekend.h` since we'll use this in several future locations.
2950+
The following changes will use the C++ standard library function `std::fabs`, which returns the
2951+
absolute value of its input, so add this to our standard header.
29492952

29502953
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
29512954
// C++ Std Usings
@@ -2960,6 +2963,7 @@
29602963
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29612964
[Listing [declare-fabs]: <kbd>[rtweekend.h]</kbd> Declaring std::fabs()]
29622965

2966+
29632967
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
29642968
class vec3 {
29652969
...

0 commit comments

Comments
 (0)