org.apache.batik.ext.awt.geom

Class Cubic

public class Cubic extends AbstractSegment

A class representing a cubic path segment.
Field Summary
Doublep1
Doublep2
Doublep3
Doublep4
Constructor Summary
Cubic()
Cubic(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Cubic(Double p1, Double p2, Double p3, Double p4)
Method Summary
Objectclone()
Doubleeval(double t)
DoubleevalDt(double t)
protected intfindRoots(double y, double[] roots)
Rectangle2DgetBounds2D()
doublegetLength()
doublegetLength(double maxErr)
SegmentgetSegment(double t0, double t1)
doublemaxX()
doublemaxY()
doubleminX()
doubleminY()
Segmentreverse()
voidsubdivide(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.
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. can be done with getSegment but this is more efficent.
voidsubdivide(double t, Cubic c0, Cubic c1)
Subdivides this Cubic curve into two curves at given t.
protected doublesubLength(double leftLegLen, double rightLegLen, double maxErr)
StringtoString()

Field Detail

p1

public Double p1

p2

public Double p2

p3

public Double p3

p4

public Double p4

Constructor Detail

Cubic

public Cubic()

Cubic

public Cubic(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)

Cubic

public Cubic(Double p1, Double p2, Double p3, Double p4)

Method Detail

clone

public Object clone()

eval

public Double eval(double t)

evalDt

public Double evalDt(double t)

findRoots

protected int findRoots(double y, double[] roots)

getBounds2D

public Rectangle2D getBounds2D()

getLength

public double getLength()

getLength

public double getLength(double maxErr)

getSegment

public Segment getSegment(double t0, double t1)

maxX

public double maxX()

maxY

public double maxY()

minX

public double minX()

minY

public double minY()

reverse

public Segment reverse()

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->.5 s1 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->.5 c1 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.

subLength

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

toString

public String toString()
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.