Skip to main content

Module nearest

Module nearest 

Source
Expand description

The point of a segment or a triangle nearest a given point: one implementation over plain coordinates, in single or double precision, a segment in any number of dimensions and a triangle in three.

Traits§

Real
A coordinate the queries work in: f32 or f64.

Functions§

nearest_on_segment
The point of the segment from a to b nearest p; a for a segment with no length.
nearest_on_triangle
The point of triangle abc nearest p. A triangle with no area answers the nearest point of its sides.
segment_param
How far along the segment from a to b its point nearest p lies, from 0 at a to 1 at b. A segment with no length answers 0, its start.