Next: , Previous: Planes Constructors, Up: Plane Reference


25.4 Operators

— Assignment operator: const Plane& operator= (const Plane& p)

Sets point to p.point, normal to p.normal, and distance to p.distance. The return value is p, so that invocations of this function can be chained.

          Point pt(2, 2.3, 6);
          Point norm(-1, 12, -36);
          Plane A(pt, norm);
          Plane B;
          Plane C;
          B = C = A;
          A.show("A:");
          -| A:
             normal: (-0.0263432, 0.316118, -0.948354)
             point: (2, 2.3, 6)
             distance == 5.01574
          cout << (A == B && A == C && B == C);
          -| 1
const operator: bool operator== (const Plane& p)

Equality operator. Compares *this and p, and returns true, if point == p.point, normal == p.normal, and distance == p.distance, otherwise false.

const operator: bool operator!= (const Plane& p)

Inequality operator. Compares *this and p and returns true, if point != p.point, or normal != p.normal, or distance != p.distance. Otherwise, it returns false.