org.apache.batik.ext.awt.geom
Class Quadradic

java.lang.Object
  extended by org.apache.batik.ext.awt.geom.AbstractSegment
      extended by org.apache.batik.ext.awt.geom.Quadradic
All Implemented Interfaces:
Cloneable, Segment

public class Quadradic
extends AbstractSegment

A class representing a quadratic path segment.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.batik.ext.awt.geom.Segment
Segment.SplitResults
 
Field Summary
 Point2D.Double p1
           
 Point2D.Double p2
           
 Point2D.Double p3
           
 
Constructor Summary
Quadradic()
           
Quadradic(double x1, double y1, double x2, double y2, double x3, double y3)
           
Quadradic(Point2D.Double p1, Point2D.Double p2, Point2D.Double p3)
           
 
Method Summary
 Object clone()
           
 Point2D.Double eval(double t)
           
 Point2D.Double evalDt(double t)
           
protected  int findRoots(double y, double[] roots)
           
 Rectangle2D getBounds2D()
           
 double getLength()
           
 double getLength(double maxErr)
           
 Segment getSegment(double t0, double t1)
           
 double maxX()
           
 double maxY()
           
 double minX()
           
 double minY()
           
 Segment reverse()
           
 void subdivide(double t, Quadradic q0, Quadradic q1)
          Subdivides this Quadradic curve into two curves at given t.
 void subdivide(double t, Segment s0, Segment s1)
          Subdivides this Quadradic curve into two curves at t.
 void subdivide(Quadradic q0, Quadradic q1)
          Subdivides this Quadradic curve into two curves at t = 0.5.
 void subdivide(Segment s0, Segment s1)
          Subdivides this Quadradic curve into two curves at t = 0.5.
protected  double subLength(double leftLegLen, double rightLegLen, double maxErr)
           
 String toString()
           
 
Methods inherited from class org.apache.batik.ext.awt.geom.AbstractSegment
matchSign, solveCubic, solveLine, solveQuad, split, splitAfter, splitBefore
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

p1

public Point2D.Double p1

p2

public Point2D.Double p2

p3

public Point2D.Double p3
Constructor Detail

Quadradic

public Quadradic()

Quadradic

public Quadradic(double x1,
                 double y1,
                 double x2,
                 double y2,
                 double x3,
                 double y3)

Quadradic

public Quadradic(Point2D.Double p1,
                 Point2D.Double p2,
                 Point2D.Double p3)
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

reverse

public Segment reverse()

minX

public double minX()

maxX

public double maxX()

minY

public double minY()

maxY

public double maxY()

getBounds2D

public Rectangle2D getBounds2D()

findRoots

protected int findRoots(double y,
                        double[] roots)
Specified by:
findRoots in class AbstractSegment

evalDt

public Point2D.Double evalDt(double t)

eval

public Point2D.Double eval(double t)

getSegment

public Segment getSegment(double t0,
                          double t1)

subdivide

public void subdivide(Quadradic q0,
                      Quadradic q1)
Subdivides this Quadradic curve into two curves at t = 0.5. can be done with getSegment but this is more efficent.

Parameters:
q0 - if non-null contains portion of curve from 0->.5
q1 - if non-null contains portion of curve from .5->1

subdivide

public void subdivide(double t,
                      Quadradic q0,
                      Quadradic q1)
Subdivides this Quadradic curve into two curves at given t.

Parameters:
q0 - if non-null contains portion of curve from 0->t.
q1 - if non-null contains portion of curve from t->1.

subdivide

public void subdivide(Segment s0,
                      Segment s1)
Subdivides this Quadradic curve into two curves at t = 0.5. can be done with getSegment but this is more efficent.

Parameters:
s0 - if non-null contains portion of curve from 0->.5
s1 - if non-null contains portion of curve from .5->1

subdivide

public void subdivide(double t,
                      Segment s0,
                      Segment s1)
Subdivides this Quadradic curve into two curves at t. can be done with getSegment but this is more efficent.

Parameters:
s0 - if non-null contains portion of curve from 0->.5
s1 - if non-null contains portion of curve from .5->1

subLength

protected double subLength(double leftLegLen,
                           double rightLegLen,
                           double maxErr)

getLength

public double getLength()

getLength

public double getLength(double maxErr)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008 Apache Software Foundation. All Rights Reserved.