/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
private double x0;
private double y0;
private double x1;
private double y1;
private double xmin;
private double xmax;
int direction)
{
super(direction);
} else {
}
}
public int getOrder() {
return 1;
}
public double getXTop() {
return x0;
}
public double getYTop() {
return y0;
}
public double getXBot() {
return x1;
}
public double getYBot() {
return y1;
}
public double getXMin() {
return xmin;
}
public double getXMax() {
return xmax;
}
public double getX0() {
}
public double getY0() {
}
public double getX1() {
}
public double getY1() {
}
public double XforY(double y) {
return x0;
}
if (y >= y1) {
return x1;
}
// assert(y0 != y1); /* No horizontal lines... */
}
public double TforY(double y) {
if (y <= y0) {
return 0;
}
if (y >= y1) {
return 1;
}
}
public double XforT(double t) {
}
public double YforT(double t) {
}
switch (deriv) {
case 0:
case 1:
default:
return 0;
}
}
switch (deriv) {
case 0:
case 1:
default:
return 0;
}
}
return t1;
}
return false;
}
return false;
}
} else {
return false;
}
}
} else {
}
return false;
}
return true;
}
return false;
}
}
return getWithDirection(dir);
}
}
}
}
}
throw new InternalError("yrange already screwed up...");
}
}
}
return 1;
}
/*
* If "this" is curve A and "other" is curve B, then...
* xA(y) = x0A + (y - y0A) (x1A - x0A) / (y1A - y0A)
* xB(y) = x0B + (y - y0B) (x1B - x0B) / (y1B - y0B)
* xA(y) == xB(y)
* x0A + (y - y0A) (x1A - x0A) / (y1A - y0A)
* == x0B + (y - y0B) (x1B - x0B) / (y1B - y0B)
* 0 == x0A (y1A - y0A) (y1B - y0B) + (y - y0A) (x1A - x0A) (y1B - y0B)
* - x0B (y1A - y0A) (y1B - y0B) - (y - y0B) (x1B - x0B) (y1A - y0A)
* 0 == (x0A - x0B) (y1A - y0A) (y1B - y0B)
* + (y - y0A) (x1A - x0A) (y1B - y0B)
* - (y - y0B) (x1B - x0B) (y1A - y0A)
* If (dxA == x1A - x0A), etc...
* 0 == (x0A - x0B) * dyA * dyB
* + (y - y0A) * dxA * dyB
* - (y - y0B) * dxB * dyA
* 0 == (x0A - x0B) * dyA * dyB
* + y * dxA * dyB - y0A * dxA * dyB
* - y * dxB * dyA + y0B * dxB * dyA
* 0 == (x0A - x0B) * dyA * dyB
* + y * dxA * dyB - y * dxB * dyA
* - y0A * dxA * dyB + y0B * dxB * dyA
* 0 == (x0A - x0B) * dyA * dyB
* + y * (dxA * dyB - dxB * dyA)
* - y0A * dxA * dyB + y0B * dxB * dyA
* y == ((x0A - x0B) * dyA * dyB
* - y0A * dxA * dyB + y0B * dxB * dyA)
* / (-(dxA * dyB - dxB * dyA))
* y == ((x0A - x0B) * dyA * dyB
* - y0A * dxA * dyB + y0B * dxB * dyA)
* / (dxB * dyA - dxA * dyB)
*/
double y;
if (denom != 0) {
if (y <= yrange[0]) {
// intersection is above us
// Use bottom-most common y for comparison
} else {
// intersection is below the top of our range
if (y < yrange[1]) {
// If intersection is in our range, adjust valid range
yrange[1] = y;
}
// Use top-most common y for comparison
}
} else {
// lines are parallel, choose any common y for comparison
// Note - prefer an endpoint for speed of calculating the X
// (see shortcuts in Order1.XforY())
}
}
if (direction == INCREASING) {
} else {
}
return PathIterator.SEG_LINETO;
}
}