21 #ifndef USOLIDS_UVector3
22 #define USOLIDS_UVector3
35 UVector3(
double xval,
double yval,
double zval)
72 inline double x()
const;
76 inline double y()
const;
80 inline double z()
const;
100 inline bool IsNull()
const;
106 inline void Set(
double xx,
double yy,
double zz);
109 inline void Set(
double xx);
118 double Theta()
const;
124 inline double Mag2()
const;
130 double Perp2()
const;
195 if (
this == &p) {
return *
this; }
213 return (v.
x_ ==
x_ && v.
y_ ==
y_ && v.
z_ ==
z_) ?
true :
false;
218 return (v.
x_ !=
x_ || v.
y_ !=
y_ || v.
z_ !=
z_) ?
true :
false;
261 return ((std::abs(
x_) + std::abs(
y_) + std::abs(
z_)) == 0.0) ?
true :
false;
300 return ptot == 0.0 ? 1.0 :
z_ / ptot;
327 double vec[3] = {
x_,
y_,
z_};
358 return os <<
"(" << v.
x() <<
"," << v.
y() <<
"," << v.
z() <<
")";
UVector3 Cross(const UVector3 &) const
double & operator[](int index)
bool operator==(const UVector3 &) const
UVector3 operator/(const UVector3 &p, double a)
UVector3(const double coord[3])
UVector3 & operator+=(const UVector3 &)
bool operator!=(const UVector3 &) const
UVector3 operator+(const UVector3 &a, const UVector3 &b)
UVector3 & operator*=(double)
std::ostream & operator<<(std::ostream &os, const UVector3 &v)
double Dot(const UVector3 &) const
UVector3(double xval, double yval, double zval)
double Angle(const UVector3 &) const
void Set(double xx, double yy, double zz)
UVector3 operator-() const
UVector3 & operator=(const UVector3 &v)
UVector3 & operator-=(const UVector3 &)
UVector3 operator-(const UVector3 &a, const UVector3 &b)
UVector3 operator*(const UVector3 &p, double a)
UVector3 & operator/=(double)
UVector3 & MultiplyByComponents(const UVector3 &p)