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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
class Triangle: public Shapes
{
friend ofstream & operator<<(ofstream &FileOut, Triangle &PointTriangle);
private:
double x, y;
Matrix Vertex1, Vertex2, Vertex3;
public:
double InputX, InputY, GetX(), GetY();
void Translate(double i, double j);
void Rescale(double i, double j);
void Rotate(double Angle);
void GetInfo();
Matrix GetVertex1(), GetVertex2(), GetVertex3();
Matrix Va, Vb, Vc;
Triangle(){x=y=0;}
Triangle(double InputX, double InputY)
{
x=InputX;
y=InputY;
Matrix Va(2,1);
Matrix Vb(2,1);
Matrix Vc(2,1);
Va.SetMatrixData(1,1,0);
Va.SetMatrixData(2,1,0);
Vb.SetMatrixData(1,1,x);
Vb.SetMatrixData(2,1,0);
Vc.SetMatrixData(1,1,(x/2));
Vc.SetMatrixData(2,1,y);
Vertex1.SetRowsColumns(2,1);
Vertex2.SetRowsColumns(2,1);
Vertex3.SetRowsColumns(2,1);
Vertex1=Va;
Vertex2=Vb;
Vertex3=Vc;
}
~Triangle(){cout<<"Triangle data removed"<<endl;}
};
|