Skip to content

distance_prDistancePrDistancePrdistance_prdistance_pr🔗

Short description🔗

distance_prDistancePrDistancePrdistance_prdistance_pr — Calculate the distance between a point and a region.

Signature🔗

distance_pr( region Region, point.y Row, point.x Column, out real DistanceMin, out real DistanceMax )void DistancePr( const HObject& Region, const HTuple& Row, const HTuple& Column, HTuple* DistanceMin, HTuple* DistanceMax )static void HOperatorSet.DistancePr( HObject region, HTuple row, HTuple column, out HTuple distanceMin, out HTuple distanceMax )def distance_pr( region: HObject, row: MaybeSequence[Union[float, int]], column: MaybeSequence[Union[float, int]] ) -> Tuple[Sequence[float], Sequence[float]]

def distance_pr_s( region: HObject, row: MaybeSequence[Union[float, int]], column: MaybeSequence[Union[float, int]] ) -> Tuple[float, float]Herror distance_pr( const Hobject Region, double Row, double Column, double* DistanceMin, double* DistanceMax )

Herror T_distance_pr( const Hobject Region, const Htuple Row, const Htuple Column, Htuple* DistanceMin, Htuple* DistanceMax )

void HRegion::DistancePr( const HTuple& Row, const HTuple& Column, HTuple* DistanceMin, HTuple* DistanceMax ) const

void HRegion::DistancePr( double Row, double Column, double* DistanceMin, double* DistanceMax ) const

void HRegion.DistancePr( HTuple row, HTuple column, out HTuple distanceMin, out HTuple distanceMax )

void HRegion.DistancePr( double row, double column, out double distanceMin, out double distanceMax )

Description🔗

The operator distance_prDistancePr calculates the distance between a point and one region. As input the coordinates of the points (Rowrowrow,Columncolumncolumn) and a region are expected. If a point is inside of the region, its minimum distance is zero. The parameters DistanceMindistanceMindistance_min and DistanceMaxdistanceMaxdistance_max return the result of the calculation.

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

  • Processed without parallelization.

Parameters🔗

Regionregionregion (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Input region.

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 coordinate of the point.

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

Minimum distance between the point and the region.

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

Maximum distance between the point and the region.

Example🔗

(HDevelop)

gen_circle (Circle, 200, 200, 100.5)
draw_point (WindowHandle, Row, Column)
gen_cross_contour_xld (Cross, Row, Column, 15, 0)
distance_pr (Circle, Row, Column, DistanceMin, DistanceMax)

Result🔗

distance_prDistancePr returns 2 (H_MSG_TRUE).

Combinations with other operators🔗

Combinations

Alternatives

distance_pcDistancePc, distance_lrDistanceLr, distance_srDistanceSr, diameter_regionDiameterRegion

See also

hamming_distanceHammingDistance, select_region_pointSelectRegionPoint, test_region_pointTestRegionPoint, smallest_rectangle2SmallestRectangle2

Module🔗

Foundation