#include "vertex.h" Vertex::Vertex() { x = y = 0; rank = 2; } void Vertex::do_copy(Vertex *v_copy) { x = v_copy->x; y = v_copy->y; rank = v_copy->rank; } Vertex::Vertex(fixedpt m_x, fixedpt m_y) { x = m_x; y = m_y; rank = 2; } Vertex::~Vertex() { } int Vertex::Equals(Vertex *other) { if (other == this) return 1; // Just in case. if (other->x == x && other->y == y) return 1; return 0; } fixedpt Vertex::Distance(Vertex *other) { fixedpt x_dist, y_dist, distance; x_dist = FSUB(x,other->x); y_dist = FSUB(y,other->y); distance = FADD(FMUL(x_dist,x_dist),FMUL(y_dist,y_dist)); return distance; }