00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_BIPOINT_H_
00028 #define CEYLAN_BIPOINT_H_
00029
00030
00031 #include "CeylanPoint.h"
00032 #include "CeylanLinear.h"
00033
00034 #include <string>
00035
00036
00037
00038 namespace Ceylan
00039 {
00040
00041 namespace Maths
00042 {
00043
00044
00045 namespace Linear
00046 {
00047
00048
00049
00050
00051 class Vector2 ;
00052
00053
00054
00055 class Matrix2 ;
00056
00057
00058
00070 class CEYLAN_DLL Bipoint : public Point
00071 {
00072
00073
00074
00075
00076
00078 friend class Vector2 ;
00079
00080
00082 friend class Matrix2 ;
00083
00084
00085
00097 CEYLAN_DLL friend bool operator == ( const Bipoint & t1,
00098 const Bipoint & t2 ) ;
00099
00100
00101
00112 CEYLAN_DLL friend bool operator != ( const Bipoint & t1,
00113 const Bipoint & t2 ) ;
00114
00115
00116
00122 CEYLAN_DLL friend Bipoint operator + ( const Bipoint & t,
00123 const Vector2 & v ) ;
00124
00125
00126
00132 CEYLAN_DLL friend Bipoint operator - ( const Bipoint & t,
00133 const Vector2 & v ) ;
00134
00135
00136
00142 CEYLAN_DLL friend Vector2 vectorize( const Bipoint & t ) ;
00143
00144
00145
00151 CEYLAN_DLL friend Vector2 vectorize( const Bipoint & t1,
00152 const Bipoint & t2 ) ;
00153
00154
00155
00156
00157 public:
00158
00159
00160
00168 explicit Bipoint( Real x0 = 0, Real x1 = 0 ) ;
00169
00170
00171
00173 virtual ~Bipoint() throw() ;
00174
00175
00176
00178 virtual void setTo( Real x0, Real x1 ) ;
00179
00180
00181
00187 virtual void setAllElementsTo( Real commonValue ) ;
00188
00189
00190
00192 virtual Real getX() const ;
00193
00194
00196 virtual Real getY() const ;
00197
00198
00199
00208 virtual Real getElementAt( MatrixIndex index ) const ;
00209
00210
00211
00220 virtual void setElementAt( MatrixIndex index,
00221 Real newValue ) ;
00222
00223
00224
00237 virtual const std::string toString(
00238 VerbosityLevels level = high ) const ;
00239
00240
00241
00246 static Real Distance( const Bipoint & first,
00247 const Bipoint & second ) ;
00248
00249
00250
00259 static Real DistancePow2( const Bipoint & first,
00260 const Bipoint & second ) ;
00261
00262
00263
00268 static const MatrixIndex Dimensions = 2 ;
00269
00270
00271
00272 protected:
00273
00274
00276 Real _coordinates[ Dimensions ] ;
00277
00278
00279
00280 } ;
00281
00282 }
00283
00284 }
00285
00286 }
00287
00288
00289
00290 #endif // CEYLAN_BIPOINT_H_
00291