Home > hfrc > matlab > utility > dist_to_line.m

dist_to_line

PURPOSE ^

DIST_TO_LINE - calculates distance a group of points is to a line.

SYNOPSIS ^

function d = dist_to_line( l, p )

DESCRIPTION ^

 DIST_TO_LINE - calculates distance a group of points is to a line.

 Usage: dist = dist_to_line( line, points )

 where line is a 2x2 matrix - each row is an [x,y] point.  points should
 be a Mx2 matrix.

 The distance returned can be negative, indicating that the point in
 question is below the line.  Use abs if you are just interested in
 distance.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     $Id: dist_to_line.m,v 1.2 2003-08-22 23:15:29 dmk Exp $    

 Copyright (C) 2001 David M. Kaplan
 Licence: GPL

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Mon 18-Dec-2006 07:26:46 by m2html © 2003