#include
int main()
{
double x,y,x0,y0,x1,y1,x2,y2,x3,y3,k1,k2;
scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3);
k1=(y0-y1)/(x0-x1);
k2=(y2-y3)/(x2-x3);
x=(k1*x0-k2*x2+y2-y0)/(k1-k2);
y=y0+(x-x0)*k1;
printf("%lf %lf\n",x,y);
return 0;
}
我测试了下,对的,你看看
