Skip to content

Commit b06194f

Browse files
authored
Merge pull request #506 from RayTracing/incl-math
Include cmath in vec3.h
2 parents b363815 + db72c63 commit b06194f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,11 @@
234234
#ifndef VEC3_H
235235
#define VEC3_H
236236

237+
#include <cmath>
237238
#include <iostream>
238239

240+
using std::sqrt;
241+
239242
class vec3 {
240243
public:
241244
vec3() : e{0,0,0} {}
@@ -1134,6 +1137,7 @@
11341137

11351138
using std::shared_ptr;
11361139
using std::make_shared;
1140+
using std::sqrt;
11371141

11381142
// Constants
11391143

src/common/rtweekend.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
using std::shared_ptr;
2121
using std::make_shared;
22+
using std::sqrt;
2223

2324
// Constants
2425

src/common/vec3.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
// along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
1212
//==============================================================================================
1313

14+
#include <cmath>
1415
#include <iostream>
1516

17+
using std::sqrt;
1618

1719
class vec3 {
1820
public:

0 commit comments

Comments
 (0)