position.h 846 B

123456789101112131415161718192021222324252627282930313233
  1. // -*- C++ -*-
  2. // Declaration of the position class, defined in pic2plot source.
  3. struct place;
  4. class position {
  5. public:
  6. double x;
  7. double y;
  8. position(double, double );
  9. position();
  10. position(const place &);
  11. position &operator+=(const position &);
  12. position &operator-=(const position &);
  13. position &operator*=(double);
  14. position &operator/=(double);
  15. };
  16. position operator-(const position &);
  17. position operator+(const position &, const position &);
  18. position operator-(const position &, const position &);
  19. position operator/(const position &, double);
  20. position operator*(const position &, double);
  21. // dot product
  22. double operator*(const position &, const position &);
  23. int operator==(const position &, const position &);
  24. int operator!=(const position &, const position &);
  25. double hypot(const position &a);
  26. typedef position distance;