Herror ::distance_ps (
    const HTuple &Row,
    const HTuple &Column,
    const HTuple &Row1,
    const HTuple &Column1,
    const HTuple &Row2,
    const HTuple &Column2,
    double *DistanceMin,
    double *DistanceMax
)
Herror ::distance_ps (
    const HTuple &Row,
    const HTuple &Column,
    const HTuple &Row1,
    const HTuple &Column1,
    const HTuple &Row2,
    const HTuple &Column2,
    HTuple *DistanceMin,
    HTuple *DistanceMax
)

Calculate the distances between a point and a line segment.

The operator ::distance_ps calculates the minimal and maximal distance between a point (Row,Column) and a line segment which is represented by the start point (Row1,Column1) and the end point (Row2,Column2). DistanceMax is the maximal distance between the point and the end points of the line segment. DistanceMin is identical to ::distance_pl in the case that the point is ``between'' the two endpoints. Otherwise the minimal distance to one of the endpoints is used.


Parameters

Row (input_control)
point.y(-array) -> HTuple.double / long
Row of the first point.

Column (input_control)
point.x(-array) -> HTuple.double / long
Column of the first point.

Row1 (input_control)
point.y(-array) -> HTuple.double / long
Row of the first point of the line segment.

Column1 (input_control)
point.x(-array) -> HTuple.double / long
Column of the first point of the line segment.

Row2 (input_control)
point.y(-array) -> HTuple.double / long
Row of the second point of the line segment.

Column2 (input_control)
point.x(-array) -> HTuple.double / long
Column of the second point of the line segment.

DistanceMin (output_control)
number(-array) -> (HTuple.) double *
Minimal distance between the point and the line segment

DistanceMax (output_control)
number(-array) -> (HTuple.) double *
Maximal distance between the point and the line segment


Example
double row,column,row1,column1,row2,column2;
double distance_min,distance_max;

distance_ps(row,column,row1,column1,row2,column2,
            &distance_min,&distance_max);

Result

::distance_ps returns H_MSG_TRUE.


Alternatives

::distance_pl


See also

::distance_pp, ::distance_pr


Module

Basic operators



Copyright © 1996-2002 MVTec Software GmbH