additional point operators

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
This commit is contained in:
Jeff Epler 2017-06-02 15:53:00 -05:00
parent 5167ba3dd7
commit 386d98d587

View file

@ -50,6 +50,18 @@ inline Point operator*(const Point &p, const PSMatrix &m) {
return Point{ p.x*m.a + p.y*m.c + m.e, return Point{ p.x*m.a + p.y*m.c + m.e,
p.x*m.b + p.y*m.d + m.f }; p.x*m.b + p.y*m.d + m.f };
} }
inline Point operator*(const Point &p, double d)
{
return Point{ p.x * d, p.y * d };
}
inline Point operator*(double d, const Point &p)
{
return Point{ p.x * d, p.y * d };
}
inline Point operator+(const Point &p, const Point &q)
{
return Point{ p.x + q.x, p.y * q.y };
}
PSMatrix operator*(const PSMatrix &m1, const PSMatrix m2); PSMatrix operator*(const PSMatrix &m1, const PSMatrix m2);