geirs2Panic  Richard J. Mathar
Fits header keyword batch editor
 All Classes Files Functions Variables Macros Pages
Point2D.h
Go to the documentation of this file.
1 #ifndef POINT2D_H
2 #define POINT2D_H
3 /*
4 * "$Header:$"
5 *
6 */
7 
8 /* forward declaration needed because we have circular apply functions.
9 #include "RotTrans2D.h"
10 */
11 class RotTrans2D ;
12 
13 using namespace std ;
14 
20 class Point2D {
21 
22 public:
25  double coord[2] ;
26 
27  Point2D(double x, double y) ;
28  Point2D(const double xandy[2]) ;
29  Point2D() ;
30  // ~Point2D() ;
31 
32  Point2D to(const Point2D & oth) const ;
33  Point2D plus(const Point2D & oth) const ;
34  Point2D turn90() const ;
35  Point2D apply(const RotTrans2D & rt) const ;
36 
37  double dist(const Point2D & oth) const ;
38 
39  double len() const ;
40 
41  double dotprod(const Point2D &oth) const ;
42 
43 #if 0
44  Point2D & operator= (const Point2D & rhs) ;
45 #endif
46  Point2D & operator-= (const Point2D & rhs) ;
47  Point2D & operator+= (const Point2D & rhs) ;
48 protected:
49 
50 private:
51 
52 } ; /* Point2D */
53 
54 Point2D operator+ (const Point2D & left, const Point2D & right) ;
55 
56 
57 #endif /* POINT2D_H */
58 
A rotation followed by a translation.
Definition: RotTrans2D.h:34
Point2D operator+(const Point2D &left, const Point2D &right)
Add two points, interpreting both points as vectors.
Definition: Point2D.cxx:194
A point with 2 coordinates represented in a Cartesian coordinate system.
Definition: Point2D.h:20