distance_lrdistance_lrDistanceLrDistanceLrdistance_lr (算子)
名称
distance_lrdistance_lrDistanceLrDistanceLrdistance_lr — 计算一条线和一个区域之间的距离。
签名
Herror distance_lr(const Hobject Region, double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax)
Herror T_distance_lr(const Hobject Region, const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2, Htuple* DistanceMin, Htuple* DistanceMax)
void DistanceLr(const HObject& Region, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax)
void HRegion::DistanceLr(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax) const
void HRegion::DistanceLr(double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax) const
static void HOperatorSet.DistanceLr(HObject region, HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distanceMin, out HTuple distanceMax)
void HRegion.DistanceLr(HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distanceMin, out HTuple distanceMax)
void HRegion.DistanceLr(double row1, double column1, double row2, double column2, out double distanceMin, out double distanceMax)
def distance_lr(region: HObject, row_1: MaybeSequence[Union[float, int]], column_1: MaybeSequence[Union[float, int]], row_2: MaybeSequence[Union[float, int]], column_2: MaybeSequence[Union[float, int]]) -> Tuple[Sequence[float], Sequence[float]]
def distance_lr_s(region: HObject, row_1: MaybeSequence[Union[float, int]], column_1: MaybeSequence[Union[float, int]], row_2: MaybeSequence[Union[float, int]], column_2: MaybeSequence[Union[float, int]]) -> Tuple[float, float]
描述
算子 distance_lrdistance_lrDistanceLrDistanceLrDistanceLrdistance_lr calculates the orthogonal
distance between a line and one region.
As input the coordinates of two points on a line
(Row1Row1Row1Row1row1row_1,Column1Column1Column1Column1column1column_1,
Row2Row2Row2Row2row2row_2,Column2Column2Column2Column2column2column_2) and one region are expected.
The parameters DistanceMinDistanceMinDistanceMinDistanceMindistanceMindistance_min and DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMaxdistance_max
return the result of the calculation.
注意
Due to efficiency of distance_lrdistance_lrDistanceLrDistanceLrDistanceLrdistance_lr
holes are ignored.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
RegionRegionRegionRegionregionregion (输入对象) region → objectHRegionHObjectHRegionHobject
Input region.
Row1Row1Row1Row1row1row_1 (输入控制) point.y(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the first point of the line.
Column1Column1Column1Column1column1column_1 (输入控制) point.x(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the first point of the line.
Row2Row2Row2Row2row2row_2 (输入控制) point.y(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the second point of the line.
Column2Column2Column2Column2column2column_2 (输入控制) point.x(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the second point of the line.
DistanceMinDistanceMinDistanceMinDistanceMindistanceMindistance_min (输出控制) real(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Minimum distance between the line and the region
DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMaxdistance_max (输出控制) real(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Maximum distance between the line and the region
示例(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_lr (Circle, Row, Column1, Row, Column2, DistanceMin, DistanceMax)
endfor
结果
distance_lrdistance_lrDistanceLrDistanceLrDistanceLrdistance_lr 返回 2 ( H_MSG_TRUE )。
替代
distance_lcdistance_lcDistanceLcDistanceLcDistanceLcdistance_lc,
distance_prdistance_prDistancePrDistancePrDistancePrdistance_pr,
distance_srdistance_srDistanceSrDistanceSrDistanceSrdistance_sr,
diameter_regiondiameter_regionDiameterRegionDiameterRegionDiameterRegiondiameter_region
另见
hamming_distancehamming_distanceHammingDistanceHammingDistanceHammingDistancehamming_distance,
select_region_pointselect_region_pointSelectRegionPointSelectRegionPointSelectRegionPointselect_region_point,
test_region_pointtest_region_pointTestRegionPointTestRegionPointTestRegionPointtest_region_point,
smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2
模块
基础