began putting everything together
This commit is contained in:
31
code/particles/P3.h
Executable file
31
code/particles/P3.h
Executable file
@@ -0,0 +1,31 @@
|
||||
#ifndef P3_H
|
||||
#define P3_H
|
||||
|
||||
struct P3 {
|
||||
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
|
||||
P3() : x(0), y(0), z(0) {;}
|
||||
P3(const double x, const double y, const double z) : x(x), y(y), z(z) {;}
|
||||
|
||||
P3 operator - (const P3& o) const {
|
||||
return P3(x-o.x, y-o.y, z-o.z);
|
||||
}
|
||||
|
||||
P3 operator + (const P3& o) const {
|
||||
return P3(x+o.x, y+o.y, z+o.z);
|
||||
}
|
||||
|
||||
P3 operator * (const double v) const {
|
||||
return P3(x*v, y*v, z*v);
|
||||
}
|
||||
|
||||
double getLength(const double floorHeight_cm) const {
|
||||
return std::sqrt(x*x + y*y + z*floorHeight_cm*z*floorHeight_cm);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // P3_H
|
||||
Reference in New Issue
Block a user