00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VECTOR3D_H
00018 #define VECTOR3D_H
00019
00020 #ifndef Q_OS_MACX
00021 #include <cmath>
00022 #else
00023 #include <math.h>
00024 #endif
00025
00026 class ANALYSIS_EXPORT Vector3D
00031 {
00032 protected:
00034 double mX;
00036 double mY;
00038 double mZ;
00039
00040 public:
00042 Vector3D( double x, double y, double z );
00044 Vector3D();
00046 Vector3D( const Vector3D& v );
00048 ~Vector3D();
00049 Vector3D& operator=( const Vector3D& v );
00050 bool operator==( const Vector3D& v );
00051 bool operator!=( const Vector3D& v );
00053 double getX() const;
00055 double getY() const;
00057 double getZ() const;
00059 double getLength() const;
00061 void setX( double x );
00063 void setY( double y );
00065 void setZ( double z );
00067 void standardise();
00068 };
00069
00070
00071
00072 inline Vector3D::Vector3D( double x, double y, double z ) : mX( x ), mY( y ), mZ( z )
00073 {
00074
00075 }
00076
00077 inline Vector3D::Vector3D() : mX( 0 ), mY( 0 ), mZ( 0 )
00078 {
00079
00080 }
00081
00082 inline Vector3D::~Vector3D()
00083 {
00084
00085 }
00086
00087
00088
00089 inline double Vector3D::getX() const
00090 {
00091 return mX;
00092 }
00093
00094 inline double Vector3D::getY() const
00095 {
00096 return mY;
00097 }
00098
00099 inline double Vector3D::getZ() const
00100 {
00101 return mZ;
00102 }
00103
00104 inline void Vector3D::setX( double x )
00105 {
00106 mX = x;
00107 }
00108
00109 inline void Vector3D::setY( double y )
00110 {
00111 mY = y;
00112 }
00113
00114 inline void Vector3D::setZ( double z )
00115 {
00116 mZ = z;
00117 }
00118
00119 #endif