Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class IVector3D {
- public:
- double getX() = 0;
- double getY() = 0;
- double getZ() = 0;
- double getLen() = 0;
- double isCollinear() = 0;
- double getAngleCos() = 0;
- }
- // =>>>>>>>>>> Other file, other class CFixedVector3D
- class CVector3D : public IVector3D {
- // ........
- }
- // =>>>>>>>>>> Other file, other class
- // The idea: if points're changed, vector changes too
- class CLinkedVector3D : public IVector3D {
- private:
- // References here!
- CPoint3D &point_begin;
- CPoint3D &point_end;
- public:
- CVector3DPointsLinked() = default;
- CVector3DPointsLinked(CPoint3D& point_begin, CPoint3D& point_end) {
- this->point_begin = point_begin;
- this->point_end = point_end;
- }
- // Other constructors
- // ...
- double getX() {
- return point_end.getX() - point_begin.getX();
- }
- // Other methods equal to CVector3D
- // ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement