#ifndef _VERTEX_H_ #define _VERTEX_H_ #include "Vector.h" class Vertex : public Vector { public: Vertex(float x0 = 0, float y0 = 0, float z0 = 0) : Vector(x0, y0, z0) {} Vertex(const Vector &v) : Vector(v) {} float distanceSq(const Vertex &v) const { Vector delta = *this - v; return delta.dot(delta); } Vector operator-(const Vertex &v) const { return Vector(x-v.x, y-v.y, z-v.z); } }; #endif /*_VERTEX_H_*/