aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/vec3.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/vec3.hpp b/include/vec3.hpp
index 4ab446d..7b0e469 100644
--- a/include/vec3.hpp
+++ b/include/vec3.hpp
@@ -28,6 +28,10 @@ class vec3 {
vec3 unit() const;
+ static vec3 random();
+
+ static vec3 random(double min, double max);
+
double x, y, z;
};
@@ -47,6 +51,12 @@ vec3 operator/(vec3 u, double scale);
std::ostream& operator<<(std::ostream& out, vec3 vec);
+vec3 random_in_unit_sphere();
+
+vec3 random_unit_vector();
+
+vec3 random_in_hemisphere(const vec3& normal);
+
using point3 = vec3;
using color = vec3;