improved printing for Point3 and Unit3

release/4.3a0
Varun Agrawal 2020-03-17 13:11:48 -04:00
parent 16dbf27375
commit 8f17fbcc8e
2 changed files with 8 additions and 2 deletions

View File

@ -29,7 +29,10 @@ bool Point3::equals(const Point3 &q, double tol) const {
}
void Point3::print(const string& s) const {
cout << s << *this << endl;
if (s.size() != 0) {
cout << s << " ";
}
cout << *this << endl;
}
/* ************************************************************************* */

View File

@ -154,7 +154,10 @@ std::ostream& operator<<(std::ostream& os, const Unit3& pair) {
/* ************************************************************************* */
void Unit3::print(const std::string& s) const {
cout << s << ":" << p_ << endl;
if(s.size() != 0) {
cout << s << ":";
}
cout << p_ << endl;
}
/* ************************************************************************* */