4 * Created on: 23 janv. 2012
14 * Point class is defined by
22 public: //----------------------------------------------------------------
29 * constructor with data
30 * Create a point at (x, y, z)
31 * @param x : The x-coordinate
32 * @param y : The y-coordinate
33 * @param z : The z-coordinate
35 Point( const double x, const double y, const double z ) ;
39 * @param p : The Point object to be copied
41 Point ( const Point & p ) ;
49 * return address of coordinate in direction i
50 * @param i : Direction
51 * @return The address of coordinate in the given direction
53 double& operator[] ( int i ) ;
57 * @return x-coordinate
63 * @return y-coordinate
69 * @return z-coordinate
74 * return Compute sum of two points
76 * @return The Compute sum of two points
78 Point operator+ ( const Point& p ) const ;
81 * return Compute difference of two points
83 * @return The Compute difference of two points
85 Point operator- ( const Point& p ) const ;
88 * return Add given point
90 * @return Add given point
92 const Point& operator+= ( const Point& p ) ;
95 * return Subtract given point
97 * @return Subtract given point
99 const Point& operator-= ( const Point& p ) ;
102 * return Multiplication with scalar
104 * @return Multiplication with scalar
106 Point operator* ( double s ) const ;
109 * return Incremental multiplication with scalar
111 * @return Incremental multiplication with scalar
113 const Point& operator*= ( double s ) ;
116 * return Division with scalar
118 * @return Division with scalar
120 Point operator/ ( double s ) const ;
123 * return Incremental Division with scalar
125 * @return Incremental Division with scalar
127 const Point& operator/= ( double s ) ;
130 * return Assignment operator
132 * @return Assignment operator
134 const Point& operator= ( const Point& p ) ;
137 * return Compute distance to given point
139 * @return The distance
141 double distance( const Point& p ) const ;
144 * return Compute norm of point representing a vector from the origin
147 double norm( void ) const ;
150 * return Compute dot product with given vector
152 * @return The dot product with given vector
154 double dot(const Point& p) const;
156 private: //----------------------------------------------------------------
160 #endif /* POINT_HXX_ */