/* University College London Dept of Physics Course in C++ 3C59 | all rights reserved 2000 | | Utility: DECLARATION of the ThreeVector class | | | Author: P.Clarke */ #ifndef _threevec_h #define _threevec_h 1 #include class ThreeVector { private: float px ; float py ; float pz ; public: // To initialise the vector with 3 cartesian momentum components // Note: this method should NOT be used after we have covered constructors void initialise( float px, float py, float pz ) ; // To return the square of the magnitude float magnitudesq( ) ; // To return the magnitude float magnitude( ) ; // To return the phi angle in the x-y plane float phi( ) ; // To perform the dot product of two vectors float dotProduct( ThreeVector t2 ) ; // To calculate the angle between two vectors in radians float angle( ThreeVector t2 ) ; // To dump out the contents to cout void dump( ) ; //.... these come later in the course...... // Default constructor ThreeVector( ) ; // Constructor to set to specified x,y,z ThreeVector( float x, float y, float z ) ; // Constructor to set it to a specified magnitude and be in the x-y plane with the given phi ThreeVector( float magnitude, float phi ) ; // Copy constructor ThreeVector( ThreeVector& src ) ; }; #endif