Point2D.h 679 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef POINT_2D__HH__
  2. #define POINT_2D__HH__
  3. #include <math.h>
  4. #ifndef PI
  5. #define PI 3.141592653589793238462643383279502f
  6. #endif
  7. #ifndef DEGREES
  8. #define DEGREES 0.01745329251994329576923690768489f
  9. #endif
  10. class CPoint2D
  11. {
  12. public:
  13. double x, y;
  14. public:
  15. CPoint2D(double x = 0, double y = 0);
  16. virtual ~CPoint2D();
  17. inline double GetDistance(CPoint2D &pt);
  18. static double GetDistance(CPoint2D &pt1, CPoint2D &pt2);
  19. };
  20. class CPointPolar2D
  21. {
  22. public:
  23. double dist, theta;
  24. public:
  25. CPointPolar2D(double d = 0, double t = 0) : dist(.0), theta(.0) { dist = d; theta = t; };
  26. virtual ~CPointPolar2D() {};
  27. };
  28. #endif