/* University College London Dept of Physics Course in C++ 3C59 | all rights reserved 2000 | | Utility: The Photon class | | This is an unbelieveably trival class used to represent a photon in | the Compton experiment monte-carlo programme used as a consolidation | excercise | | It is so trivial I havnt even written a .cpp file and ive also | putmin some of the const qualifiers. | | Author: P.Clarke */ #ifndef __photon_h__ #define __photon_h__ 1 #define M_PI 3.14159 class Photon { private: float m_energy ; // Photon energy float m_angle ; // Photon angle in degrees public: // Constructor: takes angle in degrees Photon( float energy, float angle ) { m_energy = energy; m_angle = angle; } // Default constructor Photon( ) { m_energy = 0.; m_angle = 0.; } // Query properties float angle( ) const { return m_angle ;} float angleRadians( ) const { return (m_angle * M_PI / 180.0) ; } // M_PI defined in cmath float energy() const { return m_energy ;} }; #endif