//File:  Vector.cpp:

#include "vector.h"
	//construct
Vector::Vector(void) { x = 0; y = 0; z = 0; };
Vector::Vector(float myx, float myy, float myz)
{
	x = myx;
	y = myy;
	z = myz;
}
void Vector::pointsToVector(Vector& v1, Vector& v2)
{
	v2.Scale(-1);
	v1.Add(v2);
	x = v1.x;
	y = v1.y;
	z = v1.z;
}
void Vector::Scale(float s)
{
	x = s * x;
	y = s * y;
	z = s * z;
}
void Vector::Add(Vector& v1, Vector& v2)
{
	v1.x = v2.x + v1.x;
	v1.y = v2.y + v1.y;
	v1.z = v2.z + v1.z;
}

Vector Vector::getVector(void)
{
	return Vector(x, y, z);
}
void Vector::Add(Vector& v1)
{
	x = x + v1.x;
	y = y + v1.y;
	z = z + v1.z;
}
void Vector::Cross(Vector& v1)
{
	float tx, ty, tz;
	tx = y * v1.z - z * v1.y;
	ty = z*v1.x - x*v1.z;
	tz = x*v1.y - y*v1.x;
	x = tx;
	y = ty;
	z = tz;
}
