improved printing for Point3 and Unit3
parent
16dbf27375
commit
8f17fbcc8e
|
@ -29,7 +29,10 @@ bool Point3::equals(const Point3 &q, double tol) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Point3::print(const string& s) const {
|
void Point3::print(const string& s) const {
|
||||||
cout << s << *this << endl;
|
if (s.size() != 0) {
|
||||||
|
cout << s << " ";
|
||||||
|
}
|
||||||
|
cout << *this << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
@ -154,7 +154,10 @@ std::ostream& operator<<(std::ostream& os, const Unit3& pair) {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Unit3::print(const std::string& s) const {
|
void Unit3::print(const std::string& s) const {
|
||||||
cout << s << ":" << p_ << endl;
|
if(s.size() != 0) {
|
||||||
|
cout << s << ":";
|
||||||
|
}
|
||||||
|
cout << p_ << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
Loading…
Reference in New Issue