t = 0.0;
/* Find distances for candidate points */
- for (i = 0; i < n_solutions; i++) {
+ for (i = 0; i < n_solutions; ++i) {
p = Bezier(V, DEGREE, t_candidate[i],
(Point2 *)NULL, (Point2 *)NULL);
new_dist = V2SquaredLength(V2Sub(&P, &p, &v));
/*Determine the c's -- these are vectors created by subtracting*/
/* point P from each of the control points */
- for (i = 0; i <= DEGREE; i++) {
+ for (i = 0; i <= DEGREE; ++i) {
V2Sub(&V[i], &P, &c[i]);
}
/* Determine the d's -- these are vectors created by subtracting*/
/* each control point from the next */
- for (i = 0; i <= DEGREE - 1; i++) {
+ for (i = 0; i <= DEGREE - 1; ++i) {
d[i] = V2ScaleII(V2Sub(&V[i+1], &V[i], &d[i]), 3.0);
}
/* Now, apply the z's to the dot products, on the skew diagonal*/
/* Also, set up the x-values, making these "points" */
w = (Point2 *)malloc((unsigned)(W_DEGREE+1) * sizeof(Point2));
- for (i = 0; i <= W_DEGREE; i++) {
+ for (i = 0; i <= W_DEGREE; ++i) {
w[i].y = 0.0;
w[i].x = (double)(i) / W_DEGREE;
}
for (k = 0; k <= n + m; k++) {
lb = MAX(0, k - m);
ub = MIN(k, n);
- for (i = lb; i <= ub; i++) {
+ for (i = lb; i <= ub; ++i) {
j = k - i;
w[i+j].y += cdTable[j][i] * z[j][i];
}
/* Gather solutions together */
- for (i = 0; i < left_count; i++) {
+ for (i = 0; i < left_count; ++i) {
t[i] = left_t[i];
}
- for (i = 0; i < right_count; i++) {
+ for (i = 0; i < right_count; ++i) {
t[i+left_count] = right_t[i];
}
int sign, old_sign; /* Sign of coefficients */
sign = old_sign = SGN(V[0].y);
- for (i = 1; i <= degree; i++) {
+ for (i = 1; i <= degree; ++i) {
sign = SGN(V[i].y);
if (sign != old_sign) n_crossings++;
old_sign = sign;
max_distance_above = max_distance_below = 0.0;
- for (i = 1; i < degree; i++)
+ for (i = 1; i < degree; ++i)
{
value = a * V[i].x + b * V[i].y + c;
}
/* Triangle computation */
- for (i = 1; i <= degree; i++) {
+ for (i = 1; i <= degree; ++i) {
for (j =0 ; j <= degree - i; j++) {
Vtemp[i][j].x =
(1.0 - t) * Vtemp[i-1][j].x + t * Vtemp[i-1][j+1].x;