]> Shamusworld >> Repos - architektonas/blobdiff - src/vector.h
Further progress on Polylines: Polylines can be selected and moved.
[architektonas] / src / vector.h
index e59b0e86eed7d1a6f8f111643742feda3bd85a4b..b6292ab997c77f06463ddec29731790803e9d0e6 100644 (file)
@@ -4,7 +4,7 @@
 // Various structures used for 3 dimensional imaging
 //
 // by James Hammons
-// (C) 2001, 2014 Underground Software
+// (C) 2001, 2018 Underground Software
 //
 
 #ifndef __VECTOR_H__
@@ -20,7 +20,8 @@ class Vector
 {
        public:
                Vector(double xx = 0, double yy = 0, double zz = 0);
-               Vector(Vector tail, Vector head);               // Create vector from two points
+               Vector(Vector tail, Vector head);       // Create vector from two points
+               Vector(const Vector &v);
                void SetAngleAndLength(double angle, double length);
                Vector operator=(Vector const v);
                Vector operator+(Vector const v);
@@ -40,8 +41,8 @@ class Vector
                Vector& operator-=(Vector const v);     // Vector minus Vector self-assignment
                Vector& operator-=(double const v);     // Vector minus constant self-assignment
 
-               bool operator==(Vector const v);                // Check for equality
-               bool operator!=(Vector const v);                // Check for inequality
+               bool operator==(Vector const v);        // Check for equality
+               bool operator!=(Vector const v);        // Check for inequality
 
                Vector Unit(void);
                double Magnitude(void);
@@ -52,13 +53,15 @@ class Vector
 
                static double Dot(Vector v1, Vector v2);
                static double Magnitude(Vector v1, Vector v2);
+               static Vector Unit(Point p1, Point p2);
                static double Angle(Point p1, Point p2);
                static double Parameter(Vector v1, Vector v2, Vector p);
                static Vector Normal(Vector v1, Vector v2);
-               static double AngleBetween(Vector a, Vector b);
+               static double AngleBetween(Vector a1, Vector a2);
+               static Point Midpoint(Point p1, Point p2);
 
        public:
-               double x, y, z;
+               double x, y, z, b; // "b" is an extra used mainly for arc bumps
 };
 
 #endif // __VECTOR_H__