aboutsummaryrefslogtreecommitdiff
path: root/src/core/vector.hpp
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-01-17 00:09:15 +0100
committerJulian T <julian@jtle.dk>2021-01-17 00:09:15 +0100
commit94217187eb2785939458f08d96c7b1b9e55439ab (patch)
treeb10e4ab95f213b13b90ac5e0053ed9e92f973693 /src/core/vector.hpp
parented14718ff073e285374fad2d3471552b9b497825 (diff)
Minor changed and draft for random samplingold_rework
Diffstat (limited to 'src/core/vector.hpp')
-rw-r--r--src/core/vector.hpp17
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();