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
|
|
|
|
2024-01-07 16:17:20 +00:00
|
|
|
class Point : public Shape {
|
2023-01-15 17:01:27 +00:00
|
|
|
public:
|
2024-01-07 16:17:20 +00:00
|
|
|
Point(double x, double y, double z);
|
|
|
|
Point(double x, double y);
|
|
|
|
Point(double val);
|
|
|
|
Point();
|
2023-01-15 17:01:27 +00:00
|
|
|
|
2024-01-07 16:17:20 +00:00
|
|
|
Point nextVector(double drawingProgress) override;
|
2024-01-07 19:48:02 +00:00
|
|
|
void scale(double x, double y, double z) override;
|
|
|
|
void translate(double x, double y, double z) override;
|
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;
|
|
|
|
|
2024-01-07 16:37:22 +00:00
|
|
|
void rotate(double rotateX, double rotateY, double rotateZ);
|
2024-01-21 22:22:03 +00:00
|
|
|
void normalize();
|
|
|
|
double innerProduct(Point& other);
|
2024-01-07 16:37:22 +00:00
|
|
|
|
2023-04-04 15:17:37 +00:00
|
|
|
// copy assignment operator
|
2024-01-07 16:17:20 +00:00
|
|
|
Point& operator=(const Point& other);
|
2024-01-21 22:22:03 +00:00
|
|
|
Point operator+(const Point& other);
|
|
|
|
Point operator-(const Point& other);
|
|
|
|
Point operator-();
|
|
|
|
Point operator*(const Point& other);
|
|
|
|
Point operator*(double scalar);
|
2023-01-15 17:01:27 +00:00
|
|
|
|
2024-01-07 16:17:20 +00:00
|
|
|
double x, y, z;
|
2023-01-15 17:01:27 +00:00
|
|
|
|
|
|
|
};
|