Changeset 2973 in Sophya for trunk/SophyaLib/SkyMap/unitvector.cc
- Timestamp:
- Jun 20, 2006, 6:01:49 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/unitvector.cc
r2615 r2973 1 // 3-D Geometry 2 // B. Revenu, G. Le Meur 2000 3 // R. Ansari (documentation 2006) 4 // DAPNIA/SPP (Saclay) / CEA LAL - IN2P3/CNRS (Orsay) 5 1 6 #include <math.h> 2 7 #include "sopnamsp.h" 3 8 #include "unitvector.h" 4 //***************************************************************************** 5 //++ 6 // Class UnitVector 7 // 8 // include unitvector.h vector3d.h math.h 9 //-- 10 //++ 11 // 12 // Links Parents 13 // 14 // Vector3d 15 // 16 //-- 17 //++ 18 // Titre Constructors 19 //-- 20 //++ 9 10 /*! 11 \class SOPHYA::UnitVector 12 \ingroup SkyMap 13 \brief Specialisation of Vector3d class for representing unit (length=1) 3-vectors. 14 */ 15 16 //! Default constructor : unit vector in the x direction 21 17 UnitVector::UnitVector() : Vector3d(1.,0.,0.) 22 //23 //--24 18 { 25 19 } 26 //++ 20 21 //! Constructor: Unit vector along the x,y,z cartesian coordinates 27 22 UnitVector::UnitVector(double x, double y, double z) : Vector3d(x,y,z) 28 //29 //--30 23 { 31 24 this->Normalize(); 32 25 } 33 //++ 26 27 //! Constructor: Unit vector along the theta,phi direction (spherical coordinates) 34 28 UnitVector::UnitVector(double theta, double phi) : Vector3d(theta,phi) 35 //36 //--37 29 { 38 30 this->Normalize(); 39 31 } 40 // ++32 //! copy constructor 41 33 UnitVector::UnitVector(const Vector3d& v) : Vector3d(v) 42 //43 //--44 34 { 45 35 this->Normalize(); 46 36 } 47 //++ 48 // Titre Public Method 49 //-- 50 //++ 37 //! print the vector on stream os 51 38 void UnitVector::Print(ostream& os) const 52 //53 //--54 39 { 55 40 os << "UnitVector : (X,Y,Z)= (" << _x << ", " << _y << ", " << _z
Note:
See TracChangeset
for help on using the changeset viewer.