Calling Sequence
Result = PNT_LINE(P0, L0, L1 [, Pl])
Arguments
P0
The location of the point.
P0
may have 2 to
n
elements, for
n
dimensions.
L0
One end-point of the line.
L0
must have same number of elements as
P0
.
L1
The other end-point of the line.
L1
must have the same number of elements as
L0
.
Pl
A named variable that will contain the location of the point on the line between
L0
and
L1
that is closest to
P0
.
Pl
is not necessarily in the interval (
L0, L1
).
Example
To print the distance between the point (2,3) and the line from (-3,3) to (5,12), and also the location of the point on the line closest to (2,3), enter the following command:
PRINT, PNT_LINE([2,3], [-3,3], [5,12], Pl), Pl
IDL prints:
3.73705 -0.793104 5.48276