Name
distance_sldistance_slDistanceSlDistanceSl — Calculate the distances between a line segment and a line.
Herror distance_sl(double RowA1, double ColumnA1, double RowA2, double ColumnA2, double RowB1, double ColumnB1, double RowB2, double ColumnB2, double* DistanceMin, double* DistanceMax)
Herror T_distance_sl(const Htuple RowA1, const Htuple ColumnA1, const Htuple RowA2, const Htuple ColumnA2, const Htuple RowB1, const Htuple ColumnB1, const Htuple RowB2, const Htuple ColumnB2, Htuple* DistanceMin, Htuple* DistanceMax)
void DistanceSl(const HTuple& RowA1, const HTuple& ColumnA1, const HTuple& RowA2, const HTuple& ColumnA2, const HTuple& RowB1, const HTuple& ColumnB1, const HTuple& RowB2, const HTuple& ColumnB2, HTuple* DistanceMin, HTuple* DistanceMax)
static void HMisc::DistanceSl(const HTuple& RowA1, const HTuple& ColumnA1, const HTuple& RowA2, const HTuple& ColumnA2, const HTuple& RowB1, const HTuple& ColumnB1, const HTuple& RowB2, const HTuple& ColumnB2, HTuple* DistanceMin, HTuple* DistanceMax)
static void HMisc::DistanceSl(double RowA1, double ColumnA1, double RowA2, double ColumnA2, double RowB1, double ColumnB1, double RowB2, double ColumnB2, double* DistanceMin, double* DistanceMax)
static void HOperatorSet.DistanceSl(HTuple rowA1, HTuple columnA1, HTuple rowA2, HTuple columnA2, HTuple rowB1, HTuple columnB1, HTuple rowB2, HTuple columnB2, out HTuple distanceMin, out HTuple distanceMax)
static void HMisc.DistanceSl(HTuple rowA1, HTuple columnA1, HTuple rowA2, HTuple columnA2, HTuple rowB1, HTuple columnB1, HTuple rowB2, HTuple columnB2, out HTuple distanceMin, out HTuple distanceMax)
static void HMisc.DistanceSl(double rowA1, double columnA1, double rowA2, double columnA2, double rowB1, double columnB1, double rowB2, double columnB2, out double distanceMin, out double distanceMax)
The operator distance_sldistance_slDistanceSlDistanceSlDistanceSl calculates the minimum and maximum
orthogonal distance between a line segment and a line.
As input the coordinates of two points on the line segment
(RowA1RowA1RowA1RowA1rowA1,ColumnA1ColumnA1ColumnA1ColumnA1columnA1,RowA2RowA2RowA2RowA2rowA2,ColumnA2ColumnA2ColumnA2ColumnA2columnA2)
and on the line
(RowB1RowB1RowB1RowB1rowB1,ColumnB1ColumnB1ColumnB1ColumnB1columnB1,RowB2RowB2RowB2RowB2rowB2,ColumnB2ColumnB2ColumnB2ColumnB2columnB2)
are expected. The parameters DistanceMinDistanceMinDistanceMinDistanceMindistanceMin and
DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMax return the result of the calculation. If the line
segments are intersecting, DistanceMinDistanceMinDistanceMinDistanceMindistanceMin returns zero.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Row coordinate of the first point of the line segment.
Column coordinate of the first point of the line segment.
Row coordinate of the second point of the line segment.
Column coordinate of the second point of the line segment.
Row coordinate of the first point of the line.
Column coordinate of the first point of the line.
Row coordinate of the second point of the line.
Column coordinate of the second point of the line.
Minimum distance between the line segment and
the line.
Maximum distance between the line segment and
the line.
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
Row1 := 300
Column1 := 200
Row2 := 100
Column2 := 400
gen_contour_polygon_xld (Line1, [Row1,Row2], [Column1,Column2])
dev_display (Line1)
Column := 50
Row := 100
Offset := 0
for RowEnd := 100 to 500 by 100
gen_contour_polygon_xld (Line2, [Row,RowEnd], \
[Column+Offset,Column+Offset])
dev_display (Line1)
distance_sl (Row, Column+Offset, RowEnd, Column+Offset, Row1, Column1, \
Row2, Column2,DistanceMin, DistanceMax)
Offset := Offset+40
endfor
create_tuple(&RowA1, 1);
set_i(RowA1, 8, 0);
create_tuple(&ColumnA1, 1);
set_i(ColumnA1, 7, 0);
create_tuple(&RowA2, 1);
set_i(RowA2, 15, 0);
create_tuple(&ColumnA2, 1);
set_i(ColumnA2, 11, 0);
create_tuple(&RowB1, 1);
set_i(RowB1, 2, 0);
create_tuple(&ColumnB1, 1);
set_i(ColumnB1, 4, 0);
create_tuple(&RowB2, 1);
set_i(RowB2, 6, 0);
create_tuple(&ColumnB2, 1);
set_i(ColumnB2, 10, 0);
T_distance_sl(RowA1,ColumnA1,RowA2,ColumnA2,RowB1,ColumnB1,RowB2,ColumnB2,
&distance_min,&distance_max);
aa_min = get_d(distance_min,0);
aa_max = get_d(distance_max,0);
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
Row1 := 300
Column1 := 200
Row2 := 100
Column2 := 400
gen_contour_polygon_xld (Line1, [Row1,Row2], [Column1,Column2])
dev_display (Line1)
Column := 50
Row := 100
Offset := 0
for RowEnd := 100 to 500 by 100
gen_contour_polygon_xld (Line2, [Row,RowEnd], \
[Column+Offset,Column+Offset])
dev_display (Line1)
distance_sl (Row, Column+Offset, RowEnd, Column+Offset, Row1, Column1, \
Row2, Column2,DistanceMin, DistanceMax)
Offset := Offset+40
endfor
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
Row1 := 300
Column1 := 200
Row2 := 100
Column2 := 400
gen_contour_polygon_xld (Line1, [Row1,Row2], [Column1,Column2])
dev_display (Line1)
Column := 50
Row := 100
Offset := 0
for RowEnd := 100 to 500 by 100
gen_contour_polygon_xld (Line2, [Row,RowEnd], \
[Column+Offset,Column+Offset])
dev_display (Line1)
distance_sl (Row, Column+Offset, RowEnd, Column+Offset, Row1, Column1, \
Row2, Column2,DistanceMin, DistanceMax)
Offset := Offset+40
endfor
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
Row1 := 300
Column1 := 200
Row2 := 100
Column2 := 400
gen_contour_polygon_xld (Line1, [Row1,Row2], [Column1,Column2])
dev_display (Line1)
Column := 50
Row := 100
Offset := 0
for RowEnd := 100 to 500 by 100
gen_contour_polygon_xld (Line2, [Row,RowEnd], \
[Column+Offset,Column+Offset])
dev_display (Line1)
distance_sl (Row, Column+Offset, RowEnd, Column+Offset, Row1, Column1, \
Row2, Column2,DistanceMin, DistanceMax)
Offset := Offset+40
endfor
distance_sldistance_slDistanceSlDistanceSlDistanceSl returns 2 (H_MSG_TRUE).
distance_pldistance_plDistancePlDistancePlDistancePl
distance_psdistance_psDistancePsDistancePsDistancePs,
distance_ppdistance_ppDistancePpDistancePpDistancePp
Foundation