Biomechanical Joint Model
 Author: Anderson Maciel

comevector3d.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Anderson Maciel                                 *
00003  *   andi.maciel@gmail.com                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  **************************************************************************/
00020 
00031 
00032 #ifndef __COME_VECTOR3D_H       
00033 #define __COME_VECTOR3D_H       
00034 
00035 #include        <algebra/comepoint3d.h>
00036 
00037 #ifndef __COME_MATRIX_H 
00038 class COME_Matrix;
00039 #endif
00040 
00041 
00043 // Class Name: COME_Vector3D (storage and manipulation of 3D vector)
00044 // Superclass: COME_Point3D
00045 // Subclasses: -
00046 
00047 class COME_Vector3D:public COME_Point3D {
00048   public:
00049           COME_Vector3D();
00050           COME_Vector3D(double xi, double yi, double zi);
00051           COME_Vector3D(const COME_Vector3D&);
00052           COME_Vector3D(const COME_Point3D&);
00053           COME_Vector3D& operator=(const COME_Vector3D&);
00054           COME_Vector3D& operator=(const COME_Point3D&);
00055           //  Comparison
00056       int operator==(const COME_Vector3D&);
00057       int operator!=(const COME_Vector3D&);
00058           //  Sum, Difference, Scalar Product
00059       COME_Point3D operator+(COME_Point3D) const;
00060 
00061       COME_Point3D operator-(COME_Point3D);
00062 
00063       COME_Vector3D operator+(const COME_Vector3D&) const;
00064       COME_Vector3D operator-(const COME_Vector3D&);
00065       COME_Vector3D operator-();
00066       COME_Vector3D operator*(const double&) const;
00067       COME_Vector3D operator/(const double&);
00068       COME_Vector3D operator*(const COME_Vector3D&);
00069           COME_Vector3D operator*(const COME_Point3D&);
00070           COME_Vector3D operator*(const COME_Matrix&);
00071       //  Immediate Sum, Difference, Scalar Product
00072       COME_Vector3D& operator+=(const COME_Vector3D&);
00073       COME_Vector3D& operator-=(const COME_Vector3D&);
00074       COME_Vector3D& operator*=(const double&);
00075       COME_Vector3D& operator/=(const double&);
00076       //  Dot Product
00077       double vpDotProduct(const COME_Vector3D&);
00078       //  Cross Product
00079       COME_Vector3D vpCrossProduct(const COME_Vector3D&);
00080           //  Vector module
00081           double vpModule() const;
00082       //  Vector normalization
00083       COME_Vector3D vpNormalize();
00084           //  Set, Get
00085           void setVector3D(COME_Point3D p);
00086           void setVector3D(double xx,double yy,double zz);
00087           void getVector3D(double &xx,double &yy,double &zz);
00088           COME_Vector3D getVector3D(void);
00089           COME_Point3D getVectorAsPoint3D(void);
00090           double getVector3DX(void);
00091           double getVector3DY(void);
00092           double getVector3DZ(void);
00093           double maxK(void);
00094 
00095           double        getAngle( COME_Vector3D& v );
00096           COME_Matrix transMult ( COME_Vector3D& v );
00097 };
00098 
00099 
00100 
00101 //  The global constant COME_Vector3Ds
00102 const COME_Vector3D VZERO ( 0.0, 0.0, 0.0 );
00103 const COME_Vector3D VX    ( 1.0, 0.0, 0.0 );
00104 const COME_Vector3D VY    ( 0.0, 1.0, 0.0 );
00105 const COME_Vector3D VZ    ( 0.0, 0.0, 1.0 );
00106 
00107 #endif

Generated on Thu Dec 1 10:13:36 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5