// file line.cpp #include #include "line.hpp" void Point::SetCoords(float xx, float yy) { x = xx; y = yy; } float Point::GetCoordX() { return x; } float Point::GetCoordY() { return y; } void Line::SetExtremes(float ax, float ay, float bx, float by) { A.SetCoords(ax,ay); B.SetCoords(bx,by); } float Line::GetLength() { dx = A.GetCoordX() - B.GetCoordX(); dy = A.GetCoordY() - B.GetCoordY(); return sqrt( dx*dx + dy*dy ); } // end of file line.cpp