Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Triad
- {
- double x,y,z;
- public:
- Triad() {}
- Triad(double _x,double _y,double _z):x(_x),y(_y),z(_z) {}
- void Get(double & xx,double &yy,double &zz) {xx=x;yy=y;zz=z;}
- virtual void Set(double xx,double yy,double zz) {x=xx;y=yy;z=zz;}
- };
- class Triangle : public Triangle
- {
- public:
- class BadSideLengthException {};
- Triangle() {}
- bool bad_sides(double xx,yy,zz,)
- {
- return (x<0 || y<0 || z<0 || x>y+z || y>x+z || z>x+y);
- }
- Triangle(double _x,double _y,double _z):Triad(_x,_y,_z) {if (bad_sides(_x,_y,_z)) throw BadSideLengthException;}
- virtual void Set(double &xx,double &yy,double &zz)
- {
- if(bad_sides(xx,yy,zz))
- throw BadSideLengthException;
- x = xx;
- y = yy;
- z = zz;
- }
- double GetSquare()
- {
- }
- double GetAngleX()
- {
- }
- double GetAngleY()
- {
- }
- double GetAngleZ()
- {
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement