initial commit before ownership transfer

This commit is contained in:
2016-01-25 17:57:49 +01:00
parent 36056ad002
commit 353bba8342
37 changed files with 7639 additions and 0 deletions

36
code/frank/Position3D.h Executable file
View File

@@ -0,0 +1,36 @@
#ifndef POSITION3D_H
#define POSITION3D_H
#include <cmath>
/**
* represents a 3D position (x,y,z)
*/
struct Position3D {
/** x-position (in centimeter) */
double xCM;
/** y-position (in centimeter) */
double yCM;
/** floor number */
int zNr;
/** ctor */
Position3D() : xCM(0), yCM(0), zNr(0) {;}
/** ctor. x,y in centimeter, z = floor-number */
Position3D(const double xCM, const double yCM, const int zNr) : xCM(xCM), yCM(yCM), zNr(zNr) {;}
/** get the distance to the given position (in centimeter) */
double getDistanceCM(const Position3D& p) const {
const double dx = xCM - p.xCM;
const double dy = yCM - p.yCM;
const double dz = (zNr - p.zNr) * 300; // 300 = average floor height (centimeter)
return std::sqrt(dx*dx + dy*dy + dz*dz);
}
};
#endif // POSITION3D_H