// Line.cpp: implementation of the Line class. // ////////////////////////////////////////////////////////////////////// #include "Line.h" #include ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// Line::Line() { } Line::Line(Point p1, Point p2) { firstPoint=p1; secondPoint=p2; } Line::~Line() { } float Line::distance() { float z; float x1,x2, y1, y2; x1=firstPoint.x; x2=secondPoint.x; y1=firstPoint.y; y2=secondPoint.y; z=(float)sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); return z; }