24 x = std::sin(theta) * std::cos(phi);
25 y = std::sin(theta) * std::sin(phi);
40 double arg =
Dot(q) / std::sqrt(ptot2);
41 if (arg > 1.0) arg = 1.0;
42 if (arg < -1.0) arg = -1.0;
52 return std::sqrt(
Mag2());
60 return std::sqrt(
Perp2());
75 if (mag2 == 0.0)
return 0.0;
85 return tot > 0.0 ? p *= (1.0 / std::sqrt(tot)) : p;
93 if (mag == 0.0)
return mag;;
105 double s = std::sin(angle);
106 double c = std::cos(angle);
116 double s = std::sin(angle);
117 double c = std::cos(angle);
127 double s = std::sin(angle);
128 double c = std::cos(angle);
UVector3 operator/(const UVector3 &p, double a)
double ATan2(double, double)
double Dot(const UVector3 &) const
UVector3 operator+(const UVector3 &a, const UVector3 &b)
double Angle(const UVector3 &) const
UVector3 operator-(const UVector3 &a, const UVector3 &b)
UVector3 operator*(const UVector3 &p, double a)