Vector3 a = axis2.first - axis1.first;
Vector3 v1 = axis1.second - axis1.first;
Vector3 v2 = axis2.second - axis2.first;
float v11 = Vector3::DotProduct(v1, v1);
float v12 = Vector3::DotProduct(v1, v2);
float v22 = Vector3::DotProduct(v2, v2);
float av1 = Vector3::DotProduct(a, v1);
float av2 = Vector3::DotProduct(a, v2);
// Решаем систему методом Крамера:
// t*v11-u*v12=av1
// t*v12-u*v22=av2
float d1 = -av1*v22+v12*av2;
float d2 = v11*av2-v22*av1;
float d = -v11*v22+v12*v12;
float t = d1/d;
float u = d2/d;
point1 = axis1.first + v1 * t;
point2 = axis2.first + v2 * u;