double pre4 = 6.0 * subdiv_step2;
double pre5 = 6.0 * subdiv_step3;
double tmp1x = x1 - x2 * 2.0 + x3;
double tmp1y = y1 - y2 * 2.0 + y3;
double tmp2x = (x2 - x3)*3.0 - x1 + x4;
double tmp2y = (y2 - y3)*3.0 - y1 + y4;
double fx = x1;
double fy = y1;
double dfx = (x2 - x1)*pre1 + tmp1x*pre2 + tmp2x*subdiv_step3;
double dfy = (y2 - y1)*pre1 + tmp1y*pre2 + tmp2y*subdiv_step3;
double ddfx = tmp1x*pre4 + tmp2x*pre5;
double ddfy = tmp1y*pre4 + tmp2y*pre5;
double dddfx = tmp2x*pre5;
double dddfy = tmp2y*pre5;
int step = NUM_STEPS;
while(step--)
{
fx += dfx;
fy += dfy;
dfx += ddfx;
dfy += ddfy;
ddfx += dddfx;
ddfy += dddfy;
CvPoint tmp1(fx,fy);
p.push_back(tmp1);
}
CvPoint tmp2(x4,y4);
p.push_back(tmp2);
}
int _tmain(int argc, _TCHAR* argv[])
{
CvPoint point[4];
point[0].x=1.0;
point[0].y=4.0;
point[1].x=2.2;
point[1].y=5.0;
point[2].x=6;
point[2].y=3;
point[3].x=8;
point[3].y=9;
vector
curve4(curvePoint,
point[0].x,point[0].y,
point[1].x,point[1].y,
point[2].x,point[2].y,
point[3].x,point[3].y
);
int i=0;
for(;i
cout<<"("<
cout<
cout<
return 0;
}