21 #ifndef USOLIDS_UVector3
22 #define USOLIDS_UVector3
35 UVector3(
double xval,
double yval,
double zval)
88 inline bool IsNull()
const;
94 inline void Set(
double xx,
double yy,
double zz);
97 inline void Set(
double xx);
106 double Theta()
const;
112 inline double Mag2()
const;
118 double Perp2()
const;
170 if (
this == &p) {
return *
this; }
188 return (v.
x ==
x && v.
y ==
y && v.
z ==
z) ?
true :
false;
193 return (v.
x !=
x || v.
y !=
y || v.
z !=
z) ?
true :
false;
236 return ((std::abs(
x) + std::abs(
y) + std::abs(
z)) == 0.0) ?
true :
false;
259 return x * p.
x +
y * p.
y +
z * p.
z;
269 return x *
x +
y *
y +
z *
z;
274 return x *
x +
y *
y;
280 return ptot == 0.0 ? 1.0 :
z / ptot;
307 double vec[3] = {
x,
y,
z};
326 return os <<
"(" << v.
x <<
"," << v.
y <<
"," << v.
z <<
")";
UVector3 Cross(const UVector3 &) const
UVector3 operator/(const UVector3 &, double a)
double & operator[](int index)
bool operator==(const UVector3 &) const
UVector3 operator+(const UVector3 &, const UVector3 &)
UVector3(const double coord[3])
double operator*(const UVector3 &, const UVector3 &)
UVector3 & operator+=(const UVector3 &)
bool operator!=(const UVector3 &) const
UVector3 & operator*=(double)
std::ostream & operator<<(std::ostream &os, const UVector3 &v)
UVector3 operator-(const UVector3 &, const UVector3 &)
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/=(double)
UVector3 & MultiplyByComponents(const UVector3 &p)