Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Public Member Functions | |
bool | intersect (Point first_point, Point second_point, Point third_point, Point forth_point) |
int | direction (Point first_point, Point second_point, Point third_point) |
bool | on_segment (Point first_point, Point second_point, Point third_point) |
intersect returns true if segments of two line intersects and false if they do not. It calls the subroutines direction which computes the orientation.
|
inline |
We will find direction of line here respect to @first_point. Here @second_point and @third_point is first and second points of the line respectively. we want a method to determine which way a given angle these three points turns. If returned number is negative, then the angle is counter-clockwise. That means the line is going to right to left. We will fount angle as clockwise if the method returns positive number.
|
inline |
This method determines whether a point known to be colinear with a segment lies on that segment.