diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-03-09 21:49:43 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-03-09 21:49:43 +0800 |
| commit | 99ac5b94e40b1b95be6ebc061f6dcee4d4dcfed5 (patch) | |
| tree | a5752bac23c6c1cbfb23130e2e51c1e1155723ec /raytracing/vec3.h | |
| parent | 82be1151b5c9e49ccba238ec6e4b18a2cb8fb23d (diff) | |
| download | rcc-project-99ac5b94e40b1b95be6ebc061f6dcee4d4dcfed5.tar.gz rcc-project-99ac5b94e40b1b95be6ebc061f6dcee4d4dcfed5.tar.xz | |
Establish a well-structured modern C++ project architecture
Focus on code quality: Treat strict warnings as errors, memory checks with Sanitizers, Clang formatting and static analysis
Performance optimization: LTO, ccache
Diffstat (limited to 'raytracing/vec3.h')
| -rw-r--r-- | raytracing/vec3.h | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/raytracing/vec3.h b/raytracing/vec3.h deleted file mode 100644 index 5fe4adf..0000000 --- a/raytracing/vec3.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef VEC_3 -#define VEC_3 - -#include <cmath> -#include <iostream> - -class vec3{ - public: - double e[3]; - - vec3() : e{0, 0, 0} {} - vec3(double e0, double e1, double e2) : e{e0, e1, e2} {} - - double x() const; - double y() const; - double z() const; - - vec3 operator-() const; - double operator[](int i) const; - double &operator[](int i); - vec3& operator+=(const vec3 & other); - vec3& operator*=(double t); - vec3& operator/=(double t); - double length() const; - double length_squared() const; - - -}; - -inline std::ostream &operator<<(std::ostream &out, const vec3 &v); -inline vec3 operator+(const vec3 &u, const vec3 &v); -inline vec3 operator-(const vec3 &u, const vec3 &v); -inline vec3 operator*(const vec3 &u, const vec3 &v); -inline vec3 operator*(double t, const vec3 &v); -inline vec3 operator*(const vec3 &v, double t); -inline vec3 operator/(const vec3 &v, double t); -inline double dot(const vec3 &u, const vec3 &v); -inline vec3 cross(const vec3 &u, const vec3 &v); -inline vec3 unit_vector(const vec3 &v); - -#endif |
