bool CXRect::Intersect(const CXPoint& C, const CXPoint& D) // line intersection { if (Sector(A.x, A.y)&Sector(B.x, B.y)) return false; CXPoint X; if (LineIntersection(C,D, CXPoint(A.x, DBL_MIN), CXPoint(A.x, DBL_MAX), &X)) return true; if (LineIntersection(C,D, CXPoint(B.x, DBL_MIN), CXPoint(B.x, DBL_MAX), &X)) return true; if (LineIntersection(C,D, CXPoint(DBL_MIN, A.y), CXPoint(DBL_MAX, A.y), &X)) return true; if (LineIntersection(C,D, CXPoint(DBL_MIN, B.y), CXPoint(DBL_MAX, B.y), &X)) return true; return false; }
CXPoint CXPoint::operator-=(const CXVector& rs) { return CXPoint(x-=rs.x, y-=rs.y); }
CXPoint CXPoint::operator+=(const CXVector& rs) { return CXPoint(x+=rs.x, y+=rs.y); }
CXPoint CXPoint::operator-(const CXVector& rs) const { return CXPoint(x-rs.x, y-rs.y); }
CXPoint CXPoint::operator+(const CXVector& rs) const { return CXPoint(x+rs.x, y+rs.y); }
CXPoint CXSize::operator-(const POINT& point) const throw() { return CXPoint(cx - point.x, cy - point.y); }