2023-01-15 17:01:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-04-04 15:17:37 +00:00
|
|
|
#include "Shape.h"
|
2023-01-15 17:01:27 +00:00
|
|
|
#include <cmath>
|
2023-04-04 15:17:37 +00:00
|
|
|
#include <string>
|
2023-01-15 17:01:27 +00:00
|
|
|
|
2023-04-04 15:17:37 +00:00
|
|
|
class Vector2 : public Shape {
|
2023-01-15 17:01:27 +00:00
|
|
|
public:
|
|
|
|
Vector2(double x, double y);
|
|
|
|
Vector2(double val);
|
|
|
|
Vector2();
|
|
|
|
|
2023-04-04 15:17:37 +00:00
|
|
|
Vector2 nextVector(double drawingProgress) override;
|
|
|
|
void rotate(double theta) override;
|
|
|
|
void scale(double x, double y) override;
|
|
|
|
void translate(double x, double y) override;
|
2023-01-23 22:40:55 +00:00
|
|
|
void reflectRelativeToVector(double x, double y);
|
2023-04-04 15:17:37 +00:00
|
|
|
double length() override;
|
2023-03-26 12:58:31 +00:00
|
|
|
double magnitude();
|
2023-04-04 15:17:37 +00:00
|
|
|
std::unique_ptr<Shape> clone() override;
|
|
|
|
std::string type() override;
|
|
|
|
|
|
|
|
// copy assignment operator
|
|
|
|
Vector2& operator=(const Vector2& other);
|
2023-01-15 17:01:27 +00:00
|
|
|
|
|
|
|
double x, y;
|
|
|
|
|
|
|
|
};
|