Possible Addition to TVector3

:smiley: I suggest that the following code be added to the TVector3.h file:

friend istream &operator>>(istream&,TVector3&);
friend ostream &operator<<(ostream&,TVector3&);

And the following code to the implementation file:

istream &operator>>(istream &is,TVector3 &v) {
//Allows to input a 3-vector
char c;
cin >> c >> v.fX;
cin >> c >> v.fY;
cin >> c >> v.fZ;
cin >> c;
return ( is );
}
ostream &operator<<(ostream &os,TVector3 &v) {
//Allows to output a 3-vector
os << "( ";
os.width(15);
os.precision(8);
os << v.fX << ", ";
os.width(15);
os.precision(8);
os << v.fY << ", “;
os.width(15);
os.precision(8);
os << v.fZ << " )”;
return ( os );
}

This would allow to do cin or cout with TVector3. What do you think?