public double getLength(double maxErr) { return getLength(); }
/** * Subdivides this Linear segment into two segments at given t. * @param s0 if non-null contains portion of curve from 0->t. * @param s1 if non-null contains portion of curve from t->1. */ public void subdivide(double t, Segment s0, Segment s1) { Linear l0=null, l1=null; if (s0 instanceof Linear) l0 = (Linear)s0; if (s1 instanceof Linear) l1 = (Linear)s1; subdivide(t, l0, l1); }
public Segment reverse() { return new Linear(new Point2D.Double(p2.x, p2.y), new Point2D.Double(p1.x, p1.y)); }
public Segment.SplitResults split(double y) { if ((y == p1.y) || (y == p2.y)) return null; if ((y <= p1.y) && (y <= p2.y)) return null; if ((y >= p1.y) && (y >= p2.y)) return null; // This should be checked for numerical stability. So you // need to ensure that p2.y-p1.y retains enough bits to be // useful. double t = (y-p1.y)/(p2.y-p1.y); Segment [] t0 = {getSegment(0,t)}; Segment [] t1 = {getSegment(t,1)}; if (p2.y < y) return new Segment.SplitResults(t0, t1); return new Segment.SplitResults(t1, t0); }
public Object clone() { return new Linear(new Point2D.Double(p1.x, p1.y), new Point2D.Double(p2.x, p2.y)); }
public Segment.SplitResults split(double y) { if ((y == p1.y) || (y == p2.y)) return null; if ((y <= p1.y) && (y <= p2.y)) return null; if ((y >= p1.y) && (y >= p2.y)) return null; // This should be checked for numerical stability. So you // need to ensure that p2.y-p1.y retains enough bits to be // useful. double t = (y-p1.y)/(p2.y-p1.y); Segment [] t0 = {getSegment(0,t)}; Segment [] t1 = {getSegment(t,1)}; if (p2.y < y) return new Segment.SplitResults(t0, t1); return new Segment.SplitResults(t1, t0); }
public Object clone() { return new Linear(new Point2D.Double(p1.x, p1.y), new Point2D.Double(p2.x, p2.y)); }
/** * Subdivides this Linear segment into two segments at t = 0.5. * can be done with getSegment but this is more efficent. * @param s0 if non-null contains portion of curve from 0->.5 * @param s1 if non-null contains portion of curve from .5->1 */ public void subdivide(Segment s0, Segment s1) { Linear l0=null, l1=null; if (s0 instanceof Linear) l0 = (Linear)s0; if (s1 instanceof Linear) l1 = (Linear)s1; subdivide(l0, l1); }
public Segment.SplitResults split(double y) { if ((y == p1.y) || (y == p2.y)) return null; if ((y <= p1.y) && (y <= p2.y)) return null; if ((y >= p1.y) && (y >= p2.y)) return null; // This should be checked for numerical stability. So you // need to ensure that p2.y-p1.y retains enough bits to be // useful. double t = (y-p1.y)/(p2.y-p1.y); Segment [] t0 = {getSegment(0,t)}; Segment [] t1 = {getSegment(t,1)}; if (p2.y < y) return new Segment.SplitResults(t0, t1); return new Segment.SplitResults(t1, t0); }
public double getLength(double maxErr) { return getLength(); }
public Segment reverse() { return new Linear(new Point2D.Double(p2.x, p2.y), new Point2D.Double(p1.x, p1.y)); }
/** * Subdivides this Linear segment into two segments at t = 0.5. * can be done with getSegment but this is more efficent. * @param s0 if non-null contains portion of curve from 0->.5 * @param s1 if non-null contains portion of curve from .5->1 */ public void subdivide(Segment s0, Segment s1) { Linear l0=null, l1=null; if (s0 instanceof Linear) l0 = (Linear)s0; if (s1 instanceof Linear) l1 = (Linear)s1; subdivide(l0, l1); }
public double getLength(double maxErr) { return getLength(); }
public Segment reverse() { return new Linear(new Point2D.Double(p2.x, p2.y), new Point2D.Double(p1.x, p1.y)); }
/** * Subdivides this Linear segment into two segments at t = 0.5. * can be done with getSegment but this is more efficent. * @param s0 if non-null contains portion of curve from 0->.5 * @param s1 if non-null contains portion of curve from .5->1 */ public void subdivide(Segment s0, Segment s1) { Linear l0=null, l1=null; if (s0 instanceof Linear) l0 = (Linear)s0; if (s1 instanceof Linear) l1 = (Linear)s1; subdivide(l0, l1); }