Start New Discussion within our Software Development Community

How would I go about refining a triangle?
So far this is what my code looks like,not finished by far

class point
        point(double i, double j,double k){x=i; y=j;z=k;}
        double getx(){return x;}
        double gety(){return y;}
        double getz(){return z;}
        bool operator == (point p){return (x==p.getx() && y==p.gety() && z==p.getz());}
        void operator = (point p){x=p.getx(); y=p.gety();z=p.getz();}
        void display(){cout<<"("<<x<<", "<<y<<", "<<z<<")";}
        double x, y, z;

class triangle
        triangle(point p1, point p2,point p3)
            { C1=p1; C2=p2; C3=p3;}
        point getC1(){return C1;}
        point getC2(){return C2;}
        point getC3(){return C3;}
        void display(){
                       cout<<"Coordinate 1: "; C1.display();
                       cout<<"  Coordinate 2: "; C2.display(); 
                       cout<<"    Coordinate 3: "; C3.display();

        void refine(list<triangle> * lptr)
                //bool coin;
                triangle * ntri;
                point * npoint;
                double midx, midy,midz;

This is where im stuck,I dont know where to go from here to refine the triangle

1) Remove display functions from these classes
- Display should come from outside

2) Actually declare the C1, C2 and C3 in your triangle class\

3) Did you really want to pass a pointer to a list of triangles?
- What is "refine" supposed to do?

This article has been dead for over six months. Start a new discussion instead.