ClassesClasses | | Operators

distance_srdistance_srDistanceSrDistanceSr (Operator)

Name

distance_srdistance_srDistanceSrDistanceSr — Calculate the distance between a line segment and one region.

Signature

distance_sr(Region : : Row1, Column1, Row2, Column2 : DistanceMin, DistanceMax)

Herror distance_sr(const Hobject Region, double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax)

Herror T_distance_sr(const Hobject Region, const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2, Htuple* DistanceMin, Htuple* DistanceMax)

void DistanceSr(const HObject& Region, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax)

void HRegion::DistanceSr(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax) const

void HRegion::DistanceSr(double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax) const

static void HOperatorSet.DistanceSr(HObject region, HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distanceMin, out HTuple distanceMax)

void HRegion.DistanceSr(HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distanceMin, out HTuple distanceMax)

void HRegion.DistanceSr(double row1, double column1, double row2, double column2, out double distanceMin, out double distanceMax)

Description

The operator distance_srdistance_srDistanceSrDistanceSrDistanceSr calculates the distance between a line segment and one region. Row1Row1Row1Row1row1, Column1Column1Column1Column1column1, Row2Row2Row2Row2row2, Column2Column2Column2Column2column2 are the start and end coordinates of a line segment. The parameters DistanceMinDistanceMinDistanceMinDistanceMindistanceMin and DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMax contain the resulting distances.

Attention

To enhance distance_srdistance_srDistanceSrDistanceSrDistanceSr, holes are ignored.

Execution Information

Parameters

RegionRegionRegionRegionregion (input_object)  region objectHRegionHRegionHobject

Input region.

Row1Row1Row1Row1row1 (input_control)  point.y(-array) HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Row coordinate of the first point of the line segment.

Column1Column1Column1Column1column1 (input_control)  point.x(-array) HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Column coordinate of the first point of the line segment.

Row2Row2Row2Row2row2 (input_control)  point.y(-array) HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Row coordinate of the second point of the line segment.

Column2Column2Column2Column2column2 (input_control)  point.x(-array) HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Column coordinate of the second point of the line segment.

DistanceMinDistanceMinDistanceMinDistanceMindistanceMin (output_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Minimum distance between the line segment and the region.

DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMax (output_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Maximum distance between the line segment and the region.

Example (HDevelop)

gen_circle (Circle, 200, 200, 100.5)
Column1 := 300
Column2 := 400
for Row := 50 to 350 by 50
  gen_contour_polygon_xld (Line, [Row,Row], [Column1,Column2])
  distance_sr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor

Example (C)

threshold(Image, &Region, 0.0, 120.0);
distance_sr(Region,row1,column1,row2,column2
            &distance_min, &distance_max);

Example (HDevelop)

gen_circle (Circle, 200, 200, 100.5)
Column1 := 300
Column2 := 400
for Row := 50 to 350 by 50
  gen_contour_polygon_xld (Line, [Row,Row], [Column1,Column2])
  distance_sr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor

Example (HDevelop)

gen_circle (Circle, 200, 200, 100.5)
Column1 := 300
Column2 := 400
for Row := 50 to 350 by 50
  gen_contour_polygon_xld (Line, [Row,Row], [Column1,Column2])
  distance_sr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor

Example (HDevelop)

gen_circle (Circle, 200, 200, 100.5)
Column1 := 300
Column2 := 400
for Row := 50 to 350 by 50
  gen_contour_polygon_xld (Line, [Row,Row], [Column1,Column2])
  distance_sr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor

Result

distance_srdistance_srDistanceSrDistanceSrDistanceSr returns 2 (H_MSG_TRUE).

Alternatives

distance_scdistance_scDistanceScDistanceScDistanceSc, distance_lrdistance_lrDistanceLrDistanceLrDistanceLr, distance_prdistance_prDistancePrDistancePrDistancePr, diameter_regiondiameter_regionDiameterRegionDiameterRegionDiameterRegion

See also

hamming_distancehamming_distanceHammingDistanceHammingDistanceHammingDistance, select_region_pointselect_region_pointSelectRegionPointSelectRegionPointSelectRegionPoint, test_region_pointtest_region_pointTestRegionPointTestRegionPointTestRegionPoint, smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2

Module

Foundation


ClassesClasses | | Operators