ClassesClassesClassesClasses | | | | Operators

distance_sldistance_slDistanceSldistance_slDistanceSlDistanceSl (Operator)

Name

distance_sldistance_slDistanceSldistance_slDistanceSlDistanceSl — Calculate the distances between a line segment and a line.

Signature

distance_sl( : : RowA1, ColumnA1, RowA2, ColumnA2, RowB1, ColumnB1, RowB2, ColumnB2 : DistanceMin, DistanceMax)

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)

Herror 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, double* DistanceMin, double* DistanceMax)

Herror 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)

void HOperatorSetX.DistanceSl(
[in] VARIANT RowA1, [in] VARIANT ColumnA1, [in] VARIANT RowA2, [in] VARIANT ColumnA2, [in] VARIANT RowB1, [in] VARIANT ColumnB1, [in] VARIANT RowB2, [in] VARIANT ColumnB2, [out] VARIANT* DistanceMin, [out] VARIANT* DistanceMax)

VARIANT HMiscX.DistanceSl(
[in] VARIANT RowA1, [in] VARIANT ColumnA1, [in] VARIANT RowA2, [in] VARIANT ColumnA2, [in] VARIANT RowB1, [in] VARIANT ColumnB1, [in] VARIANT RowB2, [in] VARIANT ColumnB2, [out] VARIANT* 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)

Description

The operator distance_sldistance_slDistanceSldistance_slDistanceSlDistanceSl 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 (RowA1RowA1RowA1RowA1RowA1rowA1,ColumnA1ColumnA1ColumnA1ColumnA1ColumnA1columnA1,RowA2RowA2RowA2RowA2RowA2rowA2,ColumnA2ColumnA2ColumnA2ColumnA2ColumnA2columnA2) and on the line (RowB1RowB1RowB1RowB1RowB1rowB1,ColumnB1ColumnB1ColumnB1ColumnB1ColumnB1columnB1,RowB2RowB2RowB2RowB2RowB2rowB2,ColumnB2ColumnB2ColumnB2ColumnB2ColumnB2columnB2) are expected. The parameters DistanceMinDistanceMinDistanceMinDistanceMinDistanceMindistanceMin and DistanceMaxDistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMax return the result of the calculation. If the line segments are intersecting, DistanceMinDistanceMinDistanceMinDistanceMinDistanceMindistanceMin returns zero.

Parallelization

Parameters

RowA1RowA1RowA1RowA1RowA1rowA1 (input_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the first point of the line segment.

ColumnA1ColumnA1ColumnA1ColumnA1ColumnA1columnA1 (input_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the first point of the line segment.

RowA2RowA2RowA2RowA2RowA2rowA2 (input_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the second point of the line segment.

ColumnA2ColumnA2ColumnA2ColumnA2ColumnA2columnA2 (input_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the second point of the line segment.

RowB1RowB1RowB1RowB1RowB1rowB1 (input_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the first point of the line.

ColumnB1ColumnB1ColumnB1ColumnB1ColumnB1columnB1 (input_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the first point of the line.

RowB2RowB2RowB2RowB2RowB2rowB2 (input_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the second point of the line.

ColumnB2ColumnB2ColumnB2ColumnB2ColumnB2columnB2 (input_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the second point of the line.

DistanceMinDistanceMinDistanceMinDistanceMinDistanceMindistanceMin (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Minimum distance between the line segment and the line.

DistanceMaxDistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMax (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum distance between the line segment and the line.

Example (HDevelop)

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

Example (C)

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);

Example (HDevelop)

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

Example (HDevelop)

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

Example (HDevelop)

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

Example (HDevelop)

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

Result

distance_sldistance_slDistanceSldistance_slDistanceSlDistanceSl returns 2 (H_MSG_TRUE).

Alternatives

distance_pldistance_plDistancePldistance_plDistancePlDistancePl

See also

distance_psdistance_psDistancePsdistance_psDistancePsDistancePs, distance_ppdistance_ppDistancePpdistance_ppDistancePpDistancePp

Module

Foundation


ClassesClassesClassesClasses | | | | Operators