#include #include using namespace std; class Point{ private: double x,y; public: Point(double x,double y){ this->x=x; this->y=y; } Point(){ } friend ostream& operator <<(ostream&, const Point&); friend istream& operator >> (istream&, Point&); void przesun(double dx, double dy){ x+=dx; y+=dy; } void jednokladnosc(double k){ x=x*k; y=y*k; } void symetriaOX(){ y=-y; } void symetriaOY(){ x=-x; } double getX(){ return x; } double getY(){return y;} }; class Trojkat{ private: Point* a; Point* b; Point* c; public: Trojkat(){ a = new Point(); b = new Point(); c = new Point(); } Trojkat(Point aa,Point bb,Point cc){ a = new Point(aa); b = new Point(bb); c = new Point(cc); } Trojkat(double ax,double ay,double bx,double by,double cx,double cy){ this->a = new Point(ax,ay); this->b = new Point(bx,by); this->c = new Point(cx,cy); } Point* getA(){ return a; } Point* getB(){ return b; } Point* getC(){ return c; } void przesun(double ax,double ay,double bx,double by,double cx,double cy) { a->przesun(ax,ay); b->przesun(bx,by); c->przesun(cx,cy); } void jednokladnosc(double ak){ a->jednokladnosc(ak); b->jednokladnosc(ak); c->jednokladnosc(ak); } void symetriaOX(){ a->symetriaOX(); b->symetriaOX(); c->symetriaOX(); } void symetriaOY(){ a->symetriaOY(); b->symetriaOY(); c->symetriaOY(); } friend ostream& operator <<(ostream&, const Trojkat&); friend istream& operator >> (istream&, Trojkat&); ~Trojkat(){ delete a; delete b; delete c; } }; ostream& operator <<(ostream& os, const Point& pp) { os << "("<>(istream& is, Point& pp) { is >> pp.x >> pp.y; return is; } ostream& operator <<(ostream& os, const Trojkat& tr) { os << "["<<*(tr.a) <<", " << *(tr.b)<< "," <<*(tr.c)<< "]"; return os; } istream& operator >>(istream& is, Trojkat& tr) { //is >> tr->a >> tr->b >> tr->c; return is; } int main(){ Point p1; cout<<"Podaj wsp p1:"; cin>>p1; Point p2(4.0,5.3); Point *wp3= new Point(2,0); cout<<"Punkty"<symetriaOX(); cout<<*wp3; cout<>tr2; //Trojkat *wt3= new Trojkat(&p1,&p2,wp3); //cout<<"tr3="<symetriaOY(); cout<<"tr1="<