1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
class line : public point //point class contains virtual function translate
{
public:
line(double X0, double Y0, double X1, double Y1);
line(void);
virtual void translate(double xT, double yT);
private:
double X0;
double Y0;
double X1;
double Y1;
};
line::line(double X0, double Y0, double X1, double Y1) : X0(X0), Y0(Y0), X1(X1), Y1(Y1)
{/*Body intentionally left empty*/}
line::line(void) : X0(0), Y0(0), X1(0), Y1(0)
{/*Body intentionally left empty*/}
void translate(double xT, double yT)
{
X0 += xT;
Y0 += yT;
X1 += xT;
Y1 += yT;
}
|