diff.sub(s0start, s1start);
Vector3d seg0dir = new Vector3d();
seg0dir.sub(s0end, s0start);
Vector3d seg1dir = new Vector3d();
seg1dir.sub(s1end, s1start);
double A = seg0dir.dot(seg0dir); // Dot(seg0dir,seg0dir);
double B = -seg0dir.dot(seg1dir); // -Dot(seg0dir,seg1dir);
double C = seg1dir.dot(seg1dir); // Dot(seg1dir,seg1dir);
double D = seg0dir.dot(diff); // Dot(seg0dir,diff);