Next: , Previous: Copying Points, Up: Point Reference


22.8 Querying

inline function: bool is_identity (void)

Returns true if transform is the identity Transform.

const inline function: Transform get_transform (void)

Returns transform.

const function: bool is_on_free_store (void)

Returns true if memory for the Point has been dynamically allocated on the free store, i.e., if the Point has been created using create_new<Point>(). See Point Reference; Constructors and Setting Functions.

const function: bool is_on_plane (const Plane& p)

Returns true, if the Point lies on the Plane p, otherwise false.

Planes are conceived of as having infinite extension, so while the Point C in [next figure] does not lie within the Rectangle r, it does lie on q, so C.is_on_plane(q) returns true.1

          Point P(1, 1, 1);
          Rectangle r(P, 4, 4, 20, 45, 35);
          Plane q = r.get_plane();
          Point A(2, 0, 2);
          Point B(2, 1.64143, 2);
          Point C(0.355028, 2.2185, 6.48628);
          cout << A.is_on_plane(q);
          -| 0
          cout << B.is_on_plane(q);
          -| 1
          cout << "C.is_on_plane(q)";
          -| 1


[Figure 80. Not displayed.]

Fig. 80.

const function: bool is_in_triangle (const Point& p0, const Point& p1, const Point& p2, [bool verbose = false, [bool test_points = true]])

Returns true, if *this lies within the triangle determined by the three Point arguments, otherwise false.

If the code calling is_in_triangle() has ensured that p_0, p_1, and p_2 determine a plane, i.e., that they are not colinear, and that *this lies in that plane, then false can be passed to is_in_triangle() as its test_points argument.

If the verbose argument is true, information resulting from the execution of the function are printed to standard output or standard error.

This function is needed for determining whether a line intersects with a polygon.


Footnotes

[1] It's unlikely that Points will lie on a Plane, unless the user constructs the case specially. In [next figure] , the coordinates for B and C were found by using Plane::intersection_point(). See Planes; Intersections.