intersection_segmentsintersection_segmentsIntersectionSegmentsIntersectionSegmentsintersection_segments (Operator)
intersection_segmentsintersection_segmentsIntersectionSegmentsIntersectionSegmentsintersection_segments
— Calculate the intersection point of two line segments
Signature
Herror intersection_segments(double Segment1Row1, double Segment1Column1, double Segment1Row2, double Segment1Column2, double Segment2Row1, double Segment2Column1, double Segment2Row2, double Segment2Column2, double* Row, double* Column, Hlong* IsOverlapping)
Herror T_intersection_segments(const Htuple Segment1Row1, const Htuple Segment1Column1, const Htuple Segment1Row2, const Htuple Segment1Column2, const Htuple Segment2Row1, const Htuple Segment2Column1, const Htuple Segment2Row2, const Htuple Segment2Column2, Htuple* Row, Htuple* Column, Htuple* IsOverlapping)
void IntersectionSegments(const HTuple& Segment1Row1, const HTuple& Segment1Column1, const HTuple& Segment1Row2, const HTuple& Segment1Column2, const HTuple& Segment2Row1, const HTuple& Segment2Column1, const HTuple& Segment2Row2, const HTuple& Segment2Column2, HTuple* Row, HTuple* Column, HTuple* IsOverlapping)
static void HOperatorSet.IntersectionSegments(HTuple segment1Row1, HTuple segment1Column1, HTuple segment1Row2, HTuple segment1Column2, HTuple segment2Row1, HTuple segment2Column1, HTuple segment2Row2, HTuple segment2Column2, out HTuple row, out HTuple column, out HTuple isOverlapping)
def intersection_segments(segment_1row_1: Union[float, int], segment_1column_1: Union[float, int], segment_1row_2: Union[float, int], segment_1column_2: Union[float, int], segment_2row_1: Union[float, int], segment_2column_1: Union[float, int], segment_2row_2: Union[float, int], segment_2column_2: Union[float, int]) -> Tuple[Sequence[float], Sequence[float], int]
def intersection_segments_s(segment_1row_1: Union[float, int], segment_1column_1: Union[float, int], segment_1row_2: Union[float, int], segment_1column_2: Union[float, int], segment_2row_1: Union[float, int], segment_2column_1: Union[float, int], segment_2row_2: Union[float, int], segment_2column_2: Union[float, int]) -> Tuple[float, float, int]
Description
intersection_segmentsintersection_segmentsIntersectionSegmentsIntersectionSegmentsintersection_segments
calculates the intersection point of two
line segments, which are defined by their endpoints
(Segment1Row1Segment1Row1Segment1Row1segment1Row1segment_1row_1
,Segment1Column1Segment1Column1Segment1Column1segment1Column1segment_1column_1
),
(Segment1Row2Segment1Row2Segment1Row2segment1Row2segment_1row_2
,Segment1Column2Segment1Column2Segment1Column2segment1Column2segment_1column_2
), and
(Segment2Row1Segment2Row1Segment2Row1segment2Row1segment_2row_1
,Segment2Column1Segment2Column1Segment2Column1segment2Column1segment_2column_1
),
(Segment2Row2Segment2Row2Segment2Row2segment2Row2segment_2row_2
,Segment2Column2Segment2Column2Segment2Column2segment2Column2segment_2column_2
) respectively.
The intersection point, if it exists, is returned in
(RowRowRowrowrow
,ColumnColumnColumncolumncolumn
).
If both segments have a part in common, IsOverlappingIsOverlappingIsOverlappingisOverlappingis_overlapping
returns the
value 1, otherwise 0 is returned.
In this case the endpoints of the mutual segment are
returned in (RowRowRowrowrow
,ColumnColumnColumncolumncolumn
).
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
Segment1Row1Segment1Row1Segment1Row1segment1Row1segment_1row_1
(input_control) point.y →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the first point
of the first segment.
Segment1Column1Segment1Column1Segment1Column1segment1Column1segment_1column_1
(input_control) point.x →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the first point
of the first segment.
Segment1Row2Segment1Row2Segment1Row2segment1Row2segment_1row_2
(input_control) point.y →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the second point
of the first segment.
Segment1Column2Segment1Column2Segment1Column2segment1Column2segment_1column_2
(input_control) point.x →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the second point
of the first segment.
Segment2Row1Segment2Row1Segment2Row1segment2Row1segment_2row_1
(input_control) point.y →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the first point
of the second segment.
Segment2Column1Segment2Column1Segment2Column1segment2Column1segment_2column_1
(input_control) point.x →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the first point
of the second segment.
Segment2Row2Segment2Row2Segment2Row2segment2Row2segment_2row_2
(input_control) point.y →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the second point
of the second segment.
Segment2Column2Segment2Column2Segment2Column2segment2Column2segment_2column_2
(input_control) point.x →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the second point
of the second segment.
RowRowRowrowrow
(output_control) point.y(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Row coordinate of the intersection point.
ColumnColumnColumncolumncolumn
(output_control) point.x(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Column coordinate of the intersection point.
IsOverlappingIsOverlappingIsOverlappingisOverlappingis_overlapping
(output_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Do both segments have a part in common?
Result
If the parameters are valid, the operator intersection_segmentsintersection_segmentsIntersectionSegmentsIntersectionSegmentsintersection_segments
returns the value 2 (
H_MSG_TRUE)
.
Alternatives
intersection_segment_contour_xldintersection_segment_contour_xldIntersectionSegmentContourXldIntersectionSegmentContourXldintersection_segment_contour_xld
,
intersection_contours_xldintersection_contours_xldIntersectionContoursXldIntersectionContoursXldintersection_contours_xld
See also
intersection_segment_lineintersection_segment_lineIntersectionSegmentLineIntersectionSegmentLineintersection_segment_line
,
intersection_linesintersection_linesIntersectionLinesIntersectionLinesintersection_lines
,
intersection_line_contour_xldintersection_line_contour_xldIntersectionLineContourXldIntersectionLineContourXldintersection_line_contour_xld
Module
Foundation