diff options
Diffstat (limited to 'src/core/vector.hpp')
-rw-r--r-- | src/core/vector.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
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 <iostream> +#include <math.h> + +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(); |