loci.visbio.util.MathUtil
loci.visbio.util.MathUtil

I split getDistance(double[] a, double[] b, double[] v, boolean segment) into three methods
  1) getDistance(same signature)
  2) double[] getProjection(same signature)
  3) getDistance(double[] p, double[] v)
so the projection of a point to a line segment can be returned separately. I wanted to get the coordinates of a projection as well as the distance for FreeformTool.java.  One can still call getDistance() as before, so no code outside of this class needs/ed to be rewritten. 
Plus, computing the distance between two points (3) is a handy method on its own.

-ACS


scifio/scifio