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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
class Hexagon: public Shapes
{
friend ostream & operator<<(ostream &ConsoleOut, Hexagon &PointHexagon);
private:
double x;
Matrix Vertex1,Vertex2,Vertex3,Vertex4,Vertex5,Vertex6;
public:
double xi;
Matrix Va,Vb,Vc,Vd,Ve,Vf;
Hexagon(){x = 0;}
Hexagon(double xi)
{
x = xi;
Matrix Va(2,1);
Matrix Vb(2,1);
Matrix Vc(2,1);
Matrix Vd(2,1);
Matrix Ve(2,1);
Matrix Vf(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,1.5*x);
Vc.SetMatrixData(2,1,x*0.5*sqrt(3.0));
Vd.SetMatrixData(1,1,x);
Vd.SetMatrixData(2,1,x*sqrt(3.0));
Ve.SetMatrixData(1,1,0);
Ve.SetMatrixData(2,1,x*sqrt(3.0));
Vf.SetMatrixData(1,1,-x*0.5);
Vf.SetMatrixData(2,1,x*sqrt(3.0)*0.5);
Vertex1.SetRowsColumns(2,1);
Vertex2.SetRowsColumns(2,1);
Vertex3.SetRowsColumns(2,1);
Vertex4.SetRowsColumns(2,1);
Vertex5.SetRowsColumns(2,1);
Vertex6.SetRowsColumns(2,1);
Vertex1 = Va;
Vertex2 = Vb;
Vertex3 = Vc;
Vertex4 = Vd;
Vertex5 = Ve;
Vertex6 = Vf;
}
~Hexagon(){cout<<"Destroying Hexagon"<<endl;}
double GetX();
Matrix GetV1();
Matrix GetV2();
Matrix GetV3();
Matrix GetV4();
Matrix GetV5();
Matrix GetV6();
void Translate(double i, double j);
void Rescale (double i, double j);
void Rotate (double Theta);
void GetInfo();
};
| |