Skip to content

distance_plDistancePlDistancePldistance_pldistance_pl🔗

Short description🔗

distance_plDistancePlDistancePldistance_pldistance_pl — Calculate the distance between one point and one line.

Signature🔗

distance_pl( point.y Row, point.x Column, point.y Row1, point.x Column1, point.y Row2, point.x Column2, out real Distance )void DistancePl( const HTuple& Row, const HTuple& Column, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* Distance )static void HOperatorSet.DistancePl( HTuple row, HTuple column, HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple distance )def distance_pl( 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]] ) -> Sequence[float]

def distance_pl_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]] ) -> floatHerror distance_pl( double Row, double Column, double Row1, double Column1, double Row2, double Column2, double* Distance )

Herror T_distance_pl( const Htuple Row, const Htuple Column, const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2, Htuple* Distance )

static HTuple HMisc::DistancePl( const HTuple& Row, const HTuple& Column, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2 )

static double HMisc::DistancePl( double Row, double Column, double Row1, double Column1, double Row2, double Column2 )

static HTuple HMisc.DistancePl( HTuple row, HTuple column, HTuple row1, HTuple column1, HTuple row2, HTuple column2 )

static double HMisc.DistancePl( double row, double column, double row1, double column1, double row2, double column2 )

Description🔗

The operator distance_plDistancePl calculates the orthogonal distance between points (Rowrowrow,Columncolumncolumn) and lines, given by two arbitrary points on the line. The result is passed in Distancedistancedistance.

Parameter Broadcasting🔗

This operator supports parameter broadcasting. This means that each parameter can be given as a tuple of length 1 or N. Parameters with tuple length 1 will be repeated internally such that the number of computed distances is always N.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

Parameters🔗

Rowrowrow (input_control) point.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Row coordinate of the point.

Columncolumncolumn (input_control) point.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Column of the point.

Row1row1row_1 (input_control) point.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Row coordinate of the first point of the line.

Column1column1column_1 (input_control) point.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Column coordinate of the first point of the line.

Row2row2row_2 (input_control) point.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Row coordinate of the second point of the line.

Column2column2column_2 (input_control) point.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Column coordinate of the second point of the line.

Distancedistancedistance (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Distance between the points.

Example🔗

(C)

double row,column,row1,column1,row2,column2,distance\;

draw_point(WindowHandle,&row,&column)\;
draw_line(WindowHandle,&row1,&column1,&row2,&column2)\;
distance_pl(row,column,row1,column1,row2,column2,&distance)\;
(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_pl (Row, Column, Row1, Column1, Row2, Column2, Distance)

Result🔗

distance_plDistancePl returns 2 (H_MSG_TRUE).

Combinations with other operators🔗

Combinations

Alternatives

distance_psDistancePs

See also

distance_ppDistancePp, distance_prDistancePr

Module🔗

Foundation