- struct SPLINEPOINT d;
- d.x = s->end.x*(3*t*t) + 3*s->control2.x*(2*t-3*t*t) +
- 3*s->control1.x*(1-4*t+3*t*t) + s->start.x*(-3+6*t-3*t*t);
- d.y = s->end.y*(3*t*t) + 3*s->control2.y*(2*t-3*t*t) +
- 3*s->control1.y*(1-4*t+3*t*t) + s->start.y*(-3+6*t-3*t*t);
- return d;
-}
-
-static int approximate2(struct cspline*s, struct qspline*q, double quality, double start, double end, int max, int depth)
-{
- int num=0;
- struct SPLINEPOINT qr1,qr2,cr1,cr2;
- double dist1,dist2;
- double qquality = quality*quality;
- int t;
- int recurse = 0;
- int probes = 15;
- struct qspline test;
- char left = 0;
- test.start = cspline_getpoint(s, start);
- test.control = cspline_getpoint(s, (start+end)/2);
- test.end = cspline_getpoint(s, end);
- fixcp(&test);
-
- if(start< 0.5) {
- test.control = cspline_getderivative(s, start);
- test.control.x *= (end-start)/2;
- test.control.y *= (end-start)/2;
- test.control.x += test.start.x;
- test.control.y += test.start.y;
- } else {
- test.control = cspline_getderivative(s, end);
- test.control.x *= -(end-start)/2;
- test.control.y *= -(end-start)/2;
- test.control.x += test.end.x;
- test.control.y += test.end.y;
- }
-
- for(t=0;t<probes;t++) {
- double pos = 0.5/(probes*2)*(t*2+1);
+ unsigned int gran = 0;
+ unsigned int istep = 0x80000000;
+ unsigned int istart = 0;
+ int num = 0;
+ int level = 0;
+
+ while(istart<0x80000000)
+ {
+ unsigned int iend = istart + istep;
+ double start = istart/(double)0x80000000;
+ double end = iend/(double)0x80000000;
+ struct qspline test;
+ double pos,qpos;
+ char left = 0,recurse=0;
+ int t;
+ int probes = 15;