These functions find the intersection point, if any, of the lines determined by p0 and p1 on the one hand, and q0 and q1 on the other.
Let
bp
be thebool_point
returned byintersection_point()
. If an intersection point is found, the correspondingPoint
will be stored inbp.pt
, otherwise,bp.pt
will be set toINVALID_POINT
. If the intersection point lies on both of the line segments,bp.b
will betrue
, otherwise,false
.The two versions use different methods of finding the intersection point. The first uses a vector calculation, the second looks for the intersections of the traces of the lines on the major planes. If the trace argument is used, the second version will be called, whether trace is
true
orfalse
. Ordinarily, there should be no need to use the trace version.Point A(-1, -1); Point B(1, 1); Point C(-1, 1); Point D(1, -1); bool_point bp = Point::intersection_point(A, B, C, D); bp.pt.dotlabel("$i$"); cout << "bp.b == " << bp.b << endl << flush; -| bp.b == 1
![]()
Fig. 94.
Point A(.5, .5); Point B(1.5, 1.5); Point C(-1, 1); Point D(1, -1); bool_point bp = Point::intersection_point(A, B, C, D, true); bp.pt.dotlabel("$i$"); cout << "bp.b == " << bp.b << endl << flush; -| bp.b == 0
![]()
Fig. 95.