From 94217187eb2785939458f08d96c7b1b9e55439ab Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 17 Jan 2021 00:09:15 +0100 Subject: Minor changed and draft for random sampling --- src/core/vector.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/core/vector.hpp') diff --git a/src/core/vector.hpp b/src/core/vector.hpp index 20e8210..adc0bae 100644 --- a/src/core/vector.hpp +++ b/src/core/vector.hpp @@ -2,12 +2,29 @@ #define VECTOR_H #include +#include + +class Vec2d { + public: + Vec2d(); + Vec2d(double x, double y); + + void set(double x, double y); + + double m_x, m_y, m_z; +}; class Vec3d { public: Vec3d(); Vec3d(double x, double y, double z); + static inline Vec3d FromSpherical(double sinTheta, double cosTheta, double phi) { + return Vec3d(sinTheta * std::cos(phi), + sinTheta * std::sin(phi), + cosTheta); + } + void set(double x, double y, double z); void normalize(); -- cgit v1.2.3