Node:Point Intersections, Next:Point Drawing Functions, Previous:Points and Lines, Up:Point Reference
bool_point intersection_point (Point p0, Point p1, Point q0, Point q1) | Static function |
bool_point intersection_point (Point p0, Point p1, Point q0, Point q1, const bool trace) | Static function |
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 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 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
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
|