Package org.apache.batik.ext.awt.geom
Class Cubic
- java.lang.Object
-
- org.apache.batik.ext.awt.geom.AbstractSegment
-
- org.apache.batik.ext.awt.geom.Cubic
-
- All Implemented Interfaces:
java.lang.Cloneable,Segment
public class Cubic extends AbstractSegment
A class representing a cubic path segment.- Version:
- $Id: Cubic.java 1805408 2017-08-18 12:21:52Z ssteiner $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.batik.ext.awt.geom.Segment
Segment.SplitResults
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()java.awt.geom.Point2D.Doubleeval(double t)java.awt.geom.Point2D.DoubleevalDt(double t)protected intfindRoots(double y, double[] roots)java.awt.geom.Rectangle2DgetBounds2D()doublegetLength()doublegetLength(double maxErr)private voidgetMinMax(double p1, double p2, double p3, double p4, double[] minMax)SegmentgetSegment(double t0, double t1)doublemaxX()doublemaxY()doubleminX()doubleminY()Segmentreverse()voidsubdivide(double t, Cubic c0, Cubic c1)Subdivides this Cubic curve into two curves at given t.voidsubdivide(double t, Segment s0, Segment s1)Subdivides this Cubic curve into two curves at given t.voidsubdivide(Cubic c0, Cubic c1)Subdivides this Cubic curve into two curves at t = 0.5.voidsubdivide(Segment s0, Segment s1)Subdivides this Cubic curve into two curves at t = 0.5.protected doublesubLength(double leftLegLen, double rightLegLen, double maxErr)java.lang.StringtoString()-
Methods inherited from class org.apache.batik.ext.awt.geom.AbstractSegment
matchSign, solveCubic, solveLine, solveQuad, split, splitAfter, splitBefore
-
-
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
reverse
public Segment reverse()
-
getMinMax
private void getMinMax(double p1, double p2, double p3, double p4, double[] minMax)
-
minX
public double minX()
-
maxX
public double maxX()
-
minY
public double minY()
-
maxY
public double maxY()
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D()
-
findRoots
protected int findRoots(double y, double[] roots)- Specified by:
findRootsin classAbstractSegment
-
evalDt
public java.awt.geom.Point2D.Double evalDt(double t)
-
eval
public java.awt.geom.Point2D.Double eval(double t)
-
subdivide
public void subdivide(Segment s0, Segment s1)
Subdivides this Cubic 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->.5s1- if non-null contains portion of curve from .5->1
-
subdivide
public void subdivide(double t, Segment s0, Segment s1)Subdivides this Cubic curve into two curves at given t.- Parameters:
s0- if non-null contains portion of curve from 0->t.s1- if non-null contains portion of curve from t->1.
-
subdivide
public void subdivide(Cubic c0, Cubic c1)
Subdivides this Cubic curve into two curves at t = 0.5. can be done with getSegment but this is more efficent.- Parameters:
c0- if non-null contains portion of curve from 0->.5c1- if non-null contains portion of curve from .5->1
-
subdivide
public void subdivide(double t, Cubic c0, Cubic c1)Subdivides this Cubic curve into two curves at given t.- Parameters:
c0- if non-null contains portion of curve from 0->t.c1- if non-null contains portion of curve from t->1.
-
getSegment
public Segment getSegment(double t0, double t1)
-
subLength
protected double subLength(double leftLegLen, double rightLegLen, double maxErr)
-
getLength
public double getLength()
-
getLength
public double getLength(double maxErr)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-