我在CFace类中,定义一个radiu函数,可是我想把x1,x2,x3,y1,y2,y3作为行参,总是出现如下错误,请问怎么解决?
F:\³ÌÐòÑо¿\2-23-06\test\CFace.cpp(14) : error C2061: syntax error : identifier 'x2'
F:\³ÌÐòÑо¿\2-23-06\test\CFace.cpp(15) : error C2511: 'radiu' : overloaded member function 'double (double)' not found in 'CFace'
f:\³ÌÐòÑо¿\2-23-06\test\cface.h(4) : see declaration of 'CFace'
Error executing cl.exe.
double CFace::radiu(double x1,x2,x3,y1,y2,y3)
{
double radiu;
double x=0;
double y=0;
x=((y2-y1)*(y3*y3-y1*y1+x3*x3-x1*x1)-(y3-y1)*(y2*y2-y1*y1+x2*x2-x1*x1))/(2*(x3-x1)*(y2-y1)-2*((x2-x1)*(y3-y1)));
y=((x2-x1)*(x3*x3-x1*x1+y3*y3-y1*y1)-(x3-x1)*(x2*x2-x1*x1+y2*y2-y1*y1))/(2*(y3-y1)*(x2-x1)-2*((y2-y1)*(x3-x1)));
radiu=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
cout<<"The radiu is:"<<radiu<<endl<<"The point is:"<<x<<endl<<y<<endl;
return radiu;
}