54 :
x(xc),
y(yc),
z(zc) {}
56 :
x(orig.
x),
y(orig.
y),
z(orig.
z) {}
59 void Set (T xc, T yc, T zc)
65 T sintheta = sqrt((T(1)-z_)*(T(1)+z_));
66 x = sintheta*cos(phi);
67 y = sintheta*sin(phi);
75 T l = T(1)/sqrt (
x*
x +
y*
y +
z*
z);
88 {
return sqrt (
x*
x +
y*
y +
z*
z); }
92 {
return (
x*
x +
y*
y +
z*
z); }
104 {
x+=vec.
x;
y+=vec.
y;
z+=vec.
z;
return *
this; }
110 {
x-=vec.
x;
y-=vec.
y;
z-=vec.
z;
return *
this; }
113 {
return vec3_t (
x*fact,
y*fact,
z*fact); }
116 { T xfact = T(1)/fact;
return vec3_t (
x*xfact,
y*xfact,
z*xfact); }
119 {
x*=fact;
y*=fact;
z*=fact;
return *
this; }
125 {
return v1.
x*v2.
x + v1.
y*v2.
y + v1.
z*v2.
z; }
135 template<
typename T>
inline std::ostream &
operator<<
138 os << v.
x <<
", " << v.y <<
", " << v.z << std::endl;
const vec3_t operator*(T fact) const
void set_z_phi(T z_, T phi)
const vec3_t operator+(const vec3_t &vec) const
vec3_t & operator-=(const vec3_t &vec)
const vec3_t operator/(T fact) const
const vec3_t operator-() const
vec3_t & operator+=(const vec3_t &vec)
vec3_t< T > crossprod(const vec3_t< T > &a, const vec3_t< T > &b)
vec3_t & operator*=(T fact)
T dotprod(const vec3_t< T > &v1, const vec3_t< T > &v2)
void Set(T xc, T yc, T zc)