Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgesl committed May 11, 2017
1 parent d4c2e37 commit a20d46b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/main/java/sun/java2d/marlin/Curve.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,3 @@ private float ROCsq(final float t) {
return dx2dy2*((dx2dy2*dx2dy2) / (dx2dy2 * ddx2ddy2 - ddxdxddydy*ddxdxddydy));
}
}

16 changes: 8 additions & 8 deletions src/main/java/sun/java2d/marlin/DHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,28 +118,28 @@ static int cubicRootsInAB(double d, double a, double b, double c,
final double phi = (1.0d/3.0d) * acos(-q / sqrt(-cb_p));
final double t = 2.0d * sqrt(-p);

pts[ off+0 ] = ( t * cos(phi));
pts[ off+1 ] = (-t * cos(phi + (PI / 3.0d)));
pts[ off+2 ] = (-t * cos(phi - (PI / 3.0d)));
pts[off + 0] = ( t * cos(phi));
pts[off + 1] = (-t * cos(phi + (PI / 3.0d)));
pts[off + 2] = (-t * cos(phi - (PI / 3.0d)));
num = 3;
} else {
final double sqrt_D = sqrt(D);
final double u = cbrt(sqrt_D - q);
final double v = - cbrt(sqrt_D + q);

pts[ off ] = (u + v);
pts[off ] = (u + v);
num = 1;

if (within(D, 0.0d, 1e-8d)) {
pts[off+1] = -(pts[off] / 2.0d);
pts[off + 1] = -(pts[off] / 2.0d);
num = 2;
}
}

final double sub = (1.0d/3.0d) * a;

for (int i = 0; i < num; ++i) {
pts[ off+i ] -= sub;
pts[off + i] -= sub;
}

return filterOutNotInAB(pts, off, num, A, B) - off;
Expand Down Expand Up @@ -213,8 +213,8 @@ static void isort(double[] a, int off, int len) {
}

// Most of these are copied from classes in java.awt.geom because we need
// both double and double versions of these functions, and Line2D, CubicCurve2D,
// QuadCurve2D don't provide the double version.
// both single and double precision variants of these functions, and Line2D,
// CubicCurve2D, QuadCurve2D don't provide them.
/**
* Subdivides the cubic curve specified by the coordinates
* stored in the <code>src</code> array at indices <code>srcoff</code>
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/sun/java2d/marlin/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,28 @@ static int cubicRootsInAB(float d, float a, float b, float c,
final double phi = (1.0d/3.0d) * acos(-q / sqrt(-cb_p));
final double t = 2.0d * sqrt(-p);

pts[ off+0 ] = (float) ( t * cos(phi));
pts[ off+1 ] = (float) (-t * cos(phi + (PI / 3.0d)));
pts[ off+2 ] = (float) (-t * cos(phi - (PI / 3.0d)));
pts[off + 0] = (float) ( t * cos(phi));
pts[off + 1] = (float) (-t * cos(phi + (PI / 3.0d)));
pts[off + 2] = (float) (-t * cos(phi - (PI / 3.0d)));
num = 3;
} else {
final double sqrt_D = sqrt(D);
final double u = cbrt(sqrt_D - q);
final double v = - cbrt(sqrt_D + q);

pts[ off ] = (float) (u + v);
pts[off ] = (float) (u + v);
num = 1;

if (within(D, 0.0d, 1e-8d)) {
pts[off+1] = -(pts[off] / 2.0f);
pts[off + 1] = -(pts[off] / 2.0f);
num = 2;
}
}

final float sub = (1.0f/3.0f) * a;

for (int i = 0; i < num; ++i) {
pts[ off+i ] -= sub;
pts[off + i] -= sub;
}

return filterOutNotInAB(pts, off, num, A, B) - off;
Expand Down

0 comments on commit a20d46b

Please sign in to comment.