/*
 * Vector2d.h
 *
 *  Created on: Feb 22, 2020
 *      Author: ayoungblood
 */

#ifndef SRC_ECS_VECTOR2D_H_
#define SRC_ECS_VECTOR2D_H_

#include <iostream>
#include <cmath>

class Vector2D
{
public:
	float x;
	float y;
	float r;
	float t;

	Vector2D();
	Vector2D(float x, float y);
	Vector2D(float r, float t, bool isPolar);

	Vector2D& Add(const Vector2D& vec);
	Vector2D& Subtract(const Vector2D& vec);
	Vector2D& Multiply(const Vector2D& vec);
	Vector2D& Divide(const Vector2D& vec);

	friend Vector2D& operator+(Vector2D& v1, const Vector2D& v2);
	friend Vector2D& operator-(Vector2D& v1, const Vector2D& v2);
	friend Vector2D& operator*(Vector2D& v1, const Vector2D& v2);
	friend Vector2D& operator/(Vector2D& v1, const Vector2D& v2);

	Vector2D& operator+=(const Vector2D& vec);
	Vector2D& operator-=(const Vector2D& vec);
	Vector2D& operator*=(const Vector2D& vec);
	Vector2D& operator/=(const Vector2D& vec);

	Vector2D& operator*(const int& i);
	Vector2D& Zero();

	friend std::ostream& operator<<(std::ostream& stream, const Vector2D& vec);

};



#endif /* SRC_ECS_VECTOR2D_H_ */
