public double[] bisector(final double[] a,final double[] b){
  double[] diff=subtractComponents(a,b);
  double[] sum=sumComponents(a,b);
  double dot=dot(diff,sum);
  double[] result=new double[diff.length + 1];
  System.arraycopy(diff,0,result,0,diff.length);
  result[diff.length]=-dot / 2;
  return result;
}

public double [ ] bisector ( final double [ ] a , final double [ ] b ) { double [ ] diff = subtractComponents ( a , b ) ; double [ ] sum = sumComponents ( a , b ) ; double dot = dot ( diff , sum ) ; double [ ] result = new double [ diff . length + 1 ] ; System . arraycopy ( diff , 0 , result , 0 , diff . length ) ; result [ diff . length ] = - dot / 2 ; return result ; }
perpendicular bisector of two points . works in any dimension . the coefficients are returned as a point of one higher dimension ( e . g . , ( a , b , c , d ) for an equation of the form ax + by + cz + d = 0 ) .
