Added Pointf equality operator (scales for comparison).

This commit is contained in:
Joseph Lenox 2018-07-04 01:04:15 -05:00 committed by Joseph Lenox
parent 4d6188e0d1
commit 04bc767421
2 changed files with 8 additions and 0 deletions

View File

@ -438,6 +438,10 @@ Pointf3::scale(double factor)
this->z *= factor;
}
bool Pointf::operator==(const Pointf& rhs) const {
return Point::new_scale(*this) == Point::new_scale(rhs);
}
void
Pointf3::translate(const Vectorf3 &vector)
{

View File

@ -116,6 +116,10 @@ class Pointf
static Pointf new_unscale(const Point &p) {
return Pointf(unscale(p.x), unscale(p.y));
};
// equality operator based on the scaled coordinates
bool operator==(const Pointf& rhs) const;
std::string wkt() const;
std::string dump_perl() const;
void scale(double factor);