/[gzz]/gzz/gfx/libutil/Vec23.hxx
ViewVC logotype

Diff of /gzz/gfx/libutil/Vec23.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by tjl, Thu Sep 26 08:31:24 2002 UTC revision 1.10 by tjl, Mon Sep 30 16:30:10 2002 UTC
# Line 65  namespace Vec23 { Line 65  namespace Vec23 {
65          T x, y, z;          T x, y, z;
66          Point3() : x(0), y(0), z(0) { }          Point3() : x(0), y(0), z(0) { }
67          Point3(T x, T y, T z) : x(x), y(y), z(z) { }          Point3(T x, T y, T z) : x(x), y(y), z(z) { }
68          Point3(Point<T> &p, T z = 0) : x(p.x), y(p.y), z(z) { }          Point3(const Point<T> &p, T z = 0) : x(p.x), y(p.y), z(z) { }
69            Point3(const Vector3<T> &v) : x(v.x), y(v.y), z(v.z) { }
70          Vector3<T> operator-(const Point3 &p) const {          Vector3<T> operator-(const Point3 &p) const {
71                  return Vector3<T>(x - p.x, y - p.y, z - p.z); }                  return Vector3<T>(x - p.x, y - p.y, z - p.z); }
72          Point3<T> operator+(const Vector3<T> v)          Point3<T> operator+(const Vector3<T> v)
# Line 119  namespace Vec23 { Line 120  namespace Vec23 {
120          T x, y, z;          T x, y, z;
121          Vector3() : x(0), y(0), z(0) { }          Vector3() : x(0), y(0), z(0) { }
122          Vector3(T x, T y, T z) : x(x), y(y), z(z) { }          Vector3(T x, T y, T z) : x(x), y(y), z(z) { }
123          Vector3(Vector<T> &v, float z) : x(v.x), y(v.y), z(z) { }          Vector3(const Vector<T> &v, float z) : x(v.x), y(v.y), z(z) { }
124            Vector3(const Point3<T> &v) : x(v.x), y(v.y), z(v.z) { }
125          Vector3 operator*(const double &s) const { return Vector3(s * x, s * y, s * z); } ;          Vector3 operator*(const double &s) const { return Vector3(s * x, s * y, s * z); } ;
126    
127          template<class U> const Vector3 &operator*=(const U &s) { x *= s; y *= s; z *= s;          template<class U> const Vector3 &operator*=(const U &s) { x *= s; y *= s; z *= s;
# Line 143  namespace Vec23 { Line 145  namespace Vec23 {
145                      x * v.y - y * v.x                      x * v.y - y * v.x
146                      );                      );
147          }          }
148            Vector3 normalized() { return (1/length()) * *this ; }
149      };      };
150      template<class T> Vector3<T> operator*(const double &s, const Vector3<T> &v) {      template<class T> Vector3<T> operator*(const double &s, const Vector3<T> &v) {
151          return v * s;          return v * s;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26