boolean leftOf(double[] a,double[] b,double[] d){
  final double bax=b[0] - a[0], bay=b[1] - a[1];
  final double dax=d[0] - a[0], day=d[1] - a[1];
  final double cross=bax * day - bay * dax;
  return cross > 1e-10 * Math.max(Math.max(bax,bay),Math.max(dax,day));
}

boolean leftOf ( double [ ] a , double [ ] b , double [ ] d ) { final double bax = b [ 0 ] - a [ 0 ] , bay = b [ 1 ] - a [ 1 ] ; final double dax = d [ 0 ] - a [ 0 ] , day = d [ 1 ] - a [ 1 ] ; final double cross = bax * day - bay * dax ; return cross > 1e-10 * Math . max ( Math . max ( bax , bay ) , Math . max ( dax , day ) ) ; }
test if the double [ ] ad is right of ab .
