distance_psdistance_psDistancePsDistancePsdistance_ps (算子)
名称
distance_psdistance_psDistancePsDistancePsdistance_ps — 计算一个点和一条线段之间的距离。
签名
Herror distance_ps(double Row, double Column, double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax)
Herror T_distance_ps(const Htuple Row, const Htuple Column, const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2, Htuple* DistanceMin, Htuple* DistanceMax)
void DistancePs(const HTuple& Row, const HTuple& Column, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax)
static void HMisc::DistancePs(const HTuple& Row, const HTuple& Column, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DistanceMin, HTuple* DistanceMax)
static void HMisc::DistancePs(double Row, double Column, double Row1, double Column1, double Row2, double Column2, double* DistanceMin, double* DistanceMax)
static void HOperatorSet.DistancePs(HTuple row, HTuple column, HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distanceMin, out HTuple distanceMax)
static void HMisc.DistancePs(HTuple row, HTuple column, HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distanceMin, out HTuple distanceMax)
static void HMisc.DistancePs(double row, double column, double row1, double column1, double row2, double column2, out double distanceMin, out double distanceMax)
def distance_ps(row: MaybeSequence[Union[float, int]], column: MaybeSequence[Union[float, int]], 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_ps_s(row: MaybeSequence[Union[float, int]], column: MaybeSequence[Union[float, int]], 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_psdistance_psDistancePsDistancePsDistancePsdistance_ps calculates the minimum and
maximum distance between a point
(RowRowRowRowrowrow,ColumnColumnColumnColumncolumncolumn) and a line segment which is represented
by the start point (Row1Row1Row1Row1row1row_1,Column1Column1Column1Column1column1column_1) and the
end point (Row2Row2Row2Row2row2row_2,Column2Column2Column2Column2column2column_2).
DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMaxdistance_max is the maximum distance between the point
and the end points of the line segment.
DistanceMinDistanceMinDistanceMinDistanceMindistanceMindistance_min is identical to distance_pldistance_plDistancePlDistancePlDistancePldistance_pl in
the case that the point is “between” the two endpoints.
Otherwise, the minimum distance to one of the end points is used.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
RowRowRowRowrowrow (输入控制) point.y(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the first point.
ColumnColumnColumnColumncolumncolumn (输入控制) point.x(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the first point.
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 segment.
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 segment.
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 segment.
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 segment.
DistanceMinDistanceMinDistanceMinDistanceMindistanceMindistance_min (输出控制) real(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Minimum distance between the point and the
line segment.
DistanceMaxDistanceMaxDistanceMaxDistanceMaxdistanceMaxdistance_max (输出控制) real(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Maximum distance between the point and the
line segment.
示例(HDevelop)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_point (WindowHandle, Row, Column)
gen_cross_contour_xld (Cross, Row, Column, 15, 0)
draw_line (WindowHandle, Row1, Column1, Row2, Column2)
gen_contour_polygon_xld (Contour, [Row1,Row2], [Column1,Column2])
distance_ps (Row, Column, Row1, Column1, Row2, Column2, \
DistanceMin, DistanceMax)
示例(C)
double row,column,row1,column1,row2,column2;
double distance_min,distance_max;
draw_point(WindowHandle,&row,&column);
draw_line(WindowHandle,&row1,&column1,&row2,&column2);
distance_pl(row,column,row1,column1,row2,column2,
&distance_min,&distance_max);
示例(HDevelop)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_point (WindowHandle, Row, Column)
gen_cross_contour_xld (Cross, Row, Column, 15, 0)
draw_line (WindowHandle, Row1, Column1, Row2, Column2)
gen_contour_polygon_xld (Contour, [Row1,Row2], [Column1,Column2])
distance_ps (Row, Column, Row1, Column1, Row2, Column2, \
DistanceMin, DistanceMax)
示例(HDevelop)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_point (WindowHandle, Row, Column)
gen_cross_contour_xld (Cross, Row, Column, 15, 0)
draw_line (WindowHandle, Row1, Column1, Row2, Column2)
gen_contour_polygon_xld (Contour, [Row1,Row2], [Column1,Column2])
distance_ps (Row, Column, Row1, Column1, Row2, Column2, \
DistanceMin, DistanceMax)
示例(HDevelop)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_point (WindowHandle, Row, Column)
gen_cross_contour_xld (Cross, Row, Column, 15, 0)
draw_line (WindowHandle, Row1, Column1, Row2, Column2)
gen_contour_polygon_xld (Contour, [Row1,Row2], [Column1,Column2])
distance_ps (Row, Column, Row1, Column1, Row2, Column2, \
DistanceMin, DistanceMax)
结果
distance_psdistance_psDistancePsDistancePsDistancePsdistance_ps 返回 2 ( H_MSG_TRUE )。
替代
distance_pldistance_plDistancePlDistancePlDistancePldistance_pl
另见
distance_ppdistance_ppDistancePpDistancePpDistancePpdistance_pp,
distance_prdistance_prDistancePrDistancePrDistancePrdistance_pr
模块
基础