67 m_x = (double)rand() / RandMax;
68 m_y = (double)rand() / RandMax;
69 m_z = (double)rand() / RandMax;
194 ASSERT( (index>=0) && (index<3) );
200 default:
return(
m_x);
225 double d1 = (
m_x - Vector.
m_x);
226 double d2 = (
m_y - Vector.
m_y);
227 double d3 = (
m_z - Vector.
m_z);
228 return( sqrt(d1*d1 + d2*d2 + d3*d3) );
236 double d1 = (
m_x - Vector.
m_x);
237 double d2 = (
m_y - Vector.
m_y);
238 double d3 = (
m_z - Vector.
m_z);
239 return(d1*d1 + d2*d2 + d3*d3);
253 return(CrossProduct);
270 char Str1[20], Str2[20], Str3[20];
272 sprintf(Str1,
"%8.3f",
m_x);
273 sprintf(Str2,
"%8.3f",
m_y);
274 sprintf(Str3,
"%8.3f",
m_z);
275 iout <<
"(" << Str1 <<
"," << Str2 <<
"," << Str3 <<
")";
283 char Word1[20], Word2[20], Word3[20];
285 if ( (fabs(
m_x)<99999) && (fabs(
m_y)<99999) && (fabs(
m_z)<99999) ) {
286 sprintf(Word1,
"%10.3f",
m_x);
287 sprintf(Word2,
"%10.3f",
m_y);
288 sprintf(Word3,
"%10.3f",
m_z);
291 sprintf(Word1,
"%10.2e",
m_x);
292 sprintf(Word2,
"%10.2e",
m_y);
293 sprintf(Word3,
"%10.2e",
m_z);
295 iout <<
"( " << Word1 <<
" " << Word2 <<
" " << Word3 <<
" )";
Bool_t Set(double x, double y, double z)
AVector operator+(const AVector &Vector)
AVector & operator+=(const AVector &Vector)
AVector cross(const AVector &Vector)
AVector & Scale(AVector &SmallVec, AVector &BigVec)
AVector & operator*=(double scalar)
AVector operator*(double scalar)
AVector & operator/=(double divisor)
double & operator[](int index)
AVector operator/(double divisor)
double dot(const AVector &Vector)
void SetEqual(AVector &Vec1, const Vector &Vec2)
AVector operator-(const AVector &Vector)
AVector & operator=(const AVector &Vector)
AVector(Vector_t Type=kRegular)