This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
neofx-zoomedit/Vertex.h

31 lines
808 B
C++

#ifndef VERTEX_H_
#define VERTEX_H_
class Vertex {
private:
float x, y;
public:
Vertex() {x = y = 0.0;}
Vertex(const Vertex &v) {x = v.x; y = v.y;}
Vertex(float x, float y) {this->x = x; this->y = y;}
float getX() const {return x;}
void setX(float x) {this->x = x;}
float getY() const {return y;}
void setY(float y) {this->y = y;}
void setLocation(const Vertex &v) {x = v.x; y = v.y;}
void setLocation(float x, float y) {this->x = x; this->y = y;}
float distanceSq(const Vertex &v) const;
float distance(const Vertex &v) const;
Vertex operator+(const Vertex &v) const;
Vertex operator-(const Vertex &v) const;
Vertex& operator+=(const Vertex &v);
Vertex& operator-=(const Vertex &v);
};
#endif /*VERTEX_H_*/