#ifndef VECTOR_H

#define VECTOR_H





// Defaults: note vectors default to <0, 0, 0>



/* Simple 3d vector class */

class Vector

{

public:

	Vector();

	Vector(double _x, double _y, double _z);

	Vector(const Vector& v);

	~Vector();



	const bool      operator == (const Vector& src) const;

	const bool      operator != (const Vector& src) const;

	Vector&			operator =  (const Vector& src);

	const Vector    operator +  (const Vector& src) const;

	const Vector    operator -  (const Vector& src) const;

	const Vector    operator -  (void) const;

	const Vector    operator *  (double scale) const;

	const Vector    operator /  (double scale) const;

	Vector&         operator += (const Vector& src);

	Vector&         operator -= (const Vector& src);

	Vector&         operator *= (double scale);

	Vector&         operator /= (double scale);

	double&			operator [] (const int index);

	const double&   operator [] (const int index) const;

	

	Vector          normalize(void);

	Vector          cross(const Vector& v) const;

	double			dot(const Vector& v) const;

	const double    length(void) const;

	double			distance(Vector v);

	Vector          reflect(Vector norm) const;

	void			print();



	double d[3];

};



// Related functions

Vector          average(Vector l1, Vector l2);

bool            collinear(Vector v1, Vector v2, Vector v3);



#endif // VECTOR_H