Algorithmic Solutions > LEDA > LEDA Guide > Geometry > Length and Distance
Length and DistanceIfp and q are POINTs and l
is a LINE then the following functions compute the square of
the distance between p and q , and l
and q , respectively.
RAT_TYPE p.sqr_dist(q); RAT_TYPE l.sqr_dist(q); Remark: In the rational kernel there are no functions to compute distances, in the floating point kernel there are, but it is not recommended to use them. We use the notation TipDo not compute distances in the floating point kernel! Here is the reason why: The distance between two points The rational kernel only provides functions to compute squared distances. The floating point kernel uses the Remark: The LEDA authors find that the computation of distances is rarely needed. |
See also:Writing Kernel Independent Code |