text: y); } Po operator*(Po a, double k) { return Po(a.x * k, a.y * k); } Po operator*(double k, Po a) { return a * k; } Po operator/(Po a, double k) { return Po(a.x / k, a.y / k); } struct Line { Po a, b; Line(const Po &a = Po(), const Po &b = Po()) : a(a), b(b) {} Line(const Line &l) : a(l.a), b(l.b) {} Line(double x0, double y0, double x1, double y1) : a(Po(x0, y0)), b(Po(x1, y1)) {} void getequation(double, double, double) const; Line operator+(Po x) const { return Line(a + x, b + x); } friend ostream &operator<<(ostream &out, Line p) { return out << p.a << "-" << p.b; } double length() const { return (b - a).length(); } bool dgt() const { return (a - b).dgt(); } void input() { a.input(), b.input(); } }; struct Seg : Line { Seg(const Po &a = Po(), const Po &b = Po()) : Line(a, b) {} Seg(const Line &l) : Line(l) {} Seg(double x0, double y0, double x1, double y1) : Line(x0, y0, x1, y1) {} }; inline double dot(const double &x1, const double &y1, const double &x2, const double &y2) { return x1 * x2 + y1 * y2; } inline double dot(const Po &a, const Po &b) { return dot(a.x, a.y, b.x, b.y); } inline double dot(const Po &p0, const Po &p1, const Po &p2) { return dot(p1 - p0, p2 - p0); } inline double dot(const Po &o, const Line &l) { return dot(o, l.a, l.b); } inline double dot(const Line &l, const Po &o) { return dot(o, l.a, l.b); } inline double dot(const Line &l1, const Line &l2) { return dot(l1.b - l1.a, l2.b - l2.a); } inline double det(const double &x1, const double &y1, const double &x2, const double &y2) { return x1 * y2 - x2 * y1; } inline double det(const Po &a, const Po &b) { return det(a.x, a.y, b.x, b.y); } inline double det(const Po &p0, const Po &p1, const Po &p2) { return det(p1 - p0, p2 - p0); } inline double det(const Po &o, const Line &l) { return det(o, l.a, l.b); } inline double det(const Line &l, const Po &o) { return det(o, l.a, l.b); } inline double det(const Line &l1, const Line &l2) { return det(l1.b - l1.a, l2.b - l2.