|
|
/*************************************************************************** vim:tabstop=4 vect.h - description ------------------- begin : Sun Jul 1 2001 copyright : (C) 2001 by Francois Biot email : fbiot@free.fr ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _vect_ #define _vect_ class point; #includeusing namespace std; class vect { public: vect () : mx(0.0), my(0.0), mz(0.0) {}; vect(float x,float y,float z) : mx(x), my(y), mz(z) {}; vect(const vect &v) : mx(v.mx), my(v.my), mz(v.mz) {}; vect(const point &start,const point &end); vect operator / (float ) const; vect operator * (float ) const; vect& operator +=(const vect & ); vect& operator -=(const vect & ); vect& operator *=(float ); vect dotprod (const vect &v) const; // produit vectoriel vect dotprod (float x,float y,float z) const; // produit vectoriel float scalar (const vect &v) const; // produit scalaire float norm () const; vect Negative () const; vect Normalized () const; void Normalize (); friend ostream& operator <<(ostream&,const vect &); friend vect operator +(const vect &v1,const vect &v2) { return vect(v1.mx+v2.mx,v1.my+v2.my,v1.mz+v2.mz); }; float mx; float my; float mz; }; #endif
Generated by: saturn on FrancoisLinux on Sun Feb 3 20:01:44 2002, using kdoc 2.0a53. |