2011-03-24 15:55:10 +00:00
|
|
|
#ifndef VECTOR_H_
|
|
|
|
#define VECTOR_H_
|
|
|
|
|
2011-04-03 12:08:31 +00:00
|
|
|
#include <cmath>
|
|
|
|
|
2011-05-26 23:22:38 +00:00
|
|
|
struct Vector {
|
2011-03-24 15:55:10 +00:00
|
|
|
public:
|
|
|
|
|
2011-04-09 19:01:19 +00:00
|
|
|
Vector(void)
|
2011-05-26 23:22:38 +00:00
|
|
|
: x(0.0), y(0.0), z(0.0), w(0.0) {
|
2011-04-09 19:01:19 +00:00
|
|
|
}
|
|
|
|
|
2011-05-26 23:22:38 +00:00
|
|
|
Vector(double x_in, double y_in, double z_in)
|
|
|
|
: x(x_in), y(y_in), z(z_in), w(0.0) {
|
2011-04-09 19:01:19 +00:00
|
|
|
}
|
|
|
|
|
2011-05-26 23:22:38 +00:00
|
|
|
Vector(double x_in, double y_in, double z_in, double w_in)
|
|
|
|
: x(x_in), y(y_in), z(z_in), w(w_in) {
|
2011-03-24 15:55:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~Vector() {
|
|
|
|
};
|
|
|
|
|
2011-04-03 12:08:31 +00:00
|
|
|
double GetMagnitude() const;
|
2011-04-09 19:29:43 +00:00
|
|
|
Vector Subtract(const Vector& vec) const;
|
|
|
|
double Dot(const Vector& vec) const;
|
2011-04-03 12:08:31 +00:00
|
|
|
|
2011-05-26 23:22:38 +00:00
|
|
|
double x;
|
|
|
|
double y;
|
|
|
|
double z;
|
|
|
|
double w;
|
2011-03-24 15:55:10 +00:00
|
|
|
};
|
|
|
|
|
2011-05-26 23:22:38 +00:00
|
|
|
#endif
|