njDistanceP2L | Japanese
    <-|INDEX|->
Returns the distance between a point and a line.

### FORMAT

      #include <Ninja.h>

      Float njDistanceP2L(*p, *l, *cp)
      NJS_POINT3 *p
      NJS_LINE *l
      NJS_POINT3 *cp

### PARAMETERS

NJS_POINT3 *p
  point data
NJS_LINE *l
  line data
NJS_POINT3 *cp
  coordinates of the base of the perpendicular from the point p to the line l

### RETURN VALUE

  Distance between a point and a line.

### FUNCTION

- Returns the distance between a point and a line.
- When parameter cp is not NULL, the coordinates of the base of the perpendicular from the point p to the line l are returned in cp.

### EXAMPLE

      NJS_POINT3 p, cp;
      NJS_LINE l;

      p.x = 6.f;
      p.y = 6.f;
      p.z = 4.f;
      l.px = 4.f;
      l.py = 3.f;
      l.pz = 2.f;
      l.vx = 3.f;
      l.vy = 2.f;
      l.vz = 1.f;

      njDistanceP2L(&p, &l, &cp);

      % Result %
      Return value  1.732051
      cp (7, 5, 3)

### NOTES

### RELATED TOPICS

  NJS_POINT3 NJS_LINE

njDistanceP2L |
    <-|INDEX|->