123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef _POINT_HPP_
- #define _POINT_HPP_
- #define NAMESPACE_POINT op
- #define NAMESPACE_POINT_BEGIN(x) namespace x {
- #define NAMESPACE_POINT_END(x) };
- #include <tuple>
- NAMESPACE_POINT_BEGIN (NAMESPACE_POINT)
- struct point
- {
- point();
- point(double x_,double y_)
- :x(x_)
- ,y(y_)
- {
-
- }
- static point min_(const point&a,const point&b);
- static point max_(const point&a,const point&b);
- void set(const point&p);
- void set(double,double);
- void swap(point&p);
- bool operator<(const point&p)const;
- static bool eq(double l,double r,double deta);
- bool empty()const;
- bool invalid()const;
- bool operator==(const point&r)const;
- double dist_direct(const point&o)const;
- double dist_direct(double x,double y)const;
- double dist(const point&o)const;
- double dist(double x,double y)const;
- double cos_k(const point&o)const;
- double sin_k(const point&o)const;
- point middle(const point&o)const;
- std::tuple<double,double,double> get_abc(const point&o)const;
- public:
- double x,y;
- };
- NAMESPACE_POINT_END(NAMESPACE_POINT)
- #endif
|