1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#include "coord3d.h" #include <string> #include <sstream> namespace PTools{ Coord3D& Coord3D::Normalize(){ dbl norm = Norm(*this); x = x / norm; y = y / norm; z = z / norm; return *this; } std::string Coord3D::toString(bool newline) { std::stringstream result; result << x << " " << y << " " << z ; if (newline) result << "\n"; return result.str(); } } |