-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrtweekend.h
More file actions
39 lines (30 loc) · 767 Bytes
/
rtweekend.h
File metadata and controls
39 lines (30 loc) · 767 Bytes
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
#ifndef RTWEEKEND_H
#define RTWEEKEND_H
#include <cmath>
#include <iostream>
#include <limits>
#include <memory>
#include <vector>
#include <cstdlib>
using std::make_shared;
using std::shared_ptr;
using std::sqrt;
const double infinity = std::numeric_limits<double>::infinity();
const double pi = 3.1415926535897932385;
inline double degrees_to_radians(double degrees) {
return degrees * pi / 180.0;
}
inline double random_double() {
return std::rand() / (RAND_MAX + 1.0);
}
inline double random_double(double min, double max) {
return min + (max - min) * random_double();
}
inline int random_int(int min, int max) {
return int(random_double(min, max + 1));
}
#include "color.h"
#include "interval.h"
#include "ray.h"
#include "vec3.h"
#endif