Skip to content

intersection_segmentsIntersectionSegmentsIntersectionSegmentsintersection_segmentsintersection_segments🔗

Short description🔗

intersection_segmentsIntersectionSegmentsIntersectionSegmentsintersection_segmentsintersection_segments — Calculate the intersection point of two line segments

Signature🔗

intersection_segments( point.y Segment1Row1, point.x Segment1Column1, point.y Segment1Row2, point.x Segment1Column2, point.y Segment2Row1, point.x Segment2Column1, point.y Segment2Row2, point.x Segment2Column2, out point.y Row, out point.x Column, out integer 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]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 )

Description🔗

intersection_segmentsIntersectionSegments calculates the intersection point of two line segments, which are defined by their endpoints (Segment1Row1segment1Row1segment_1row_1,Segment1Column1segment1Column1segment_1column_1), (Segment1Row2segment1Row2segment_1row_2,Segment1Column2segment1Column2segment_1column_2), and (Segment2Row1segment2Row1segment_2row_1,Segment2Column1segment2Column1segment_2column_1), (Segment2Row2segment2Row2segment_2row_2,Segment2Column2segment2Column2segment_2column_2) respectively. The intersection point, if it exists, is returned in (Rowrowrow,Columncolumncolumn). If both segments have a part in common, IsOverlappingisOverlappingis_overlapping returns the value 1, otherwise 0 is returned. In this case the endpoints of the mutual segment are returned in (Rowrowrow,Columncolumncolumn).

Execution information🔗

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🔗

Segment1Row1segment1Row1segment_1row_1 (input_control) point.y → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Row coordinate of the first point of the first segment.

Segment1Column1segment1Column1segment_1column_1 (input_control) point.x → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Column coordinate of the first point of the first segment.

Segment1Row2segment1Row2segment_1row_2 (input_control) point.y → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Row coordinate of the second point of the first segment.

Segment1Column2segment1Column2segment_1column_2 (input_control) point.x → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Column coordinate of the second point of the first segment.

Segment2Row1segment2Row1segment_2row_1 (input_control) point.y → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Row coordinate of the first point of the second segment.

Segment2Column1segment2Column1segment_2column_1 (input_control) point.x → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Column coordinate of the first point of the second segment.

Segment2Row2segment2Row2segment_2row_2 (input_control) point.y → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Row coordinate of the second point of the second segment.

Segment2Column2segment2Column2segment_2column_2 (input_control) point.x → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Column coordinate of the second point of the second segment.

Rowrowrow (output_control) point.y(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinate of the intersection point.

Columncolumncolumn (output_control) point.x(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinate of the intersection point.

IsOverlappingisOverlappingis_overlapping (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Do both segments have a part in common?

Result🔗

If the parameters are valid, the operator intersection_segmentsIntersectionSegments returns the value 2 (H_MSG_TRUE).

Combinations with other operators🔗

Combinations

Alternatives

intersection_segment_contour_xldIntersectionSegmentContourXld, intersection_contours_xldIntersectionContoursXld

See also

intersection_segment_lineIntersectionSegmentLine, intersection_linesIntersectionLines, intersection_line_contour_xldIntersectionLineContourXld

Module🔗

Foundation