org.apache.batik.ext.awt.geom

Class Linear

public class Linear extends Object implements Segment

A class representing a linear path segment.
Field Summary
Doublep1
Doublep2
Constructor Summary
Linear()
Linear(double x1, double y1, double x2, double y2)
Linear(Double p1, Double p2)
Method Summary
Objectclone()
Doubleeval(double t)
DoubleevalDt(double t)
Rectangle2DgetBounds2D()
doublegetLength()
doublegetLength(double maxErr)
SegmentgetSegment(double t0, double t1)
doublemaxX()
doublemaxY()
doubleminX()
doubleminY()
Segmentreverse()
Segment.SplitResultssplit(double y)
SegmentsplitAfter(double t)
SegmentsplitBefore(double t)
voidsubdivide(Segment s0, Segment s1)
Subdivides this Linear segment into two segments at t = 0.5. can be done with getSegment but this is more efficent.
voidsubdivide(double t, Segment s0, Segment s1)
Subdivides this Linear segment into two segments at given t.
voidsubdivide(Linear l0, Linear l1)
Subdivides this Cubic curve into two curves at t = 0.5.
voidsubdivide(double t, Linear l0, Linear l1)
Subdivides this Cubic curve into two curves.
StringtoString()

Field Detail

p1

public Double p1

p2

public Double p2

Constructor Detail

Linear

public Linear()

Linear

public Linear(double x1, double y1, double x2, double y2)

Linear

public Linear(Double p1, Double p2)

Method Detail

clone

public Object clone()

eval

public Double eval(double t)

evalDt

public Double evalDt(double t)

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()

split

public Segment.SplitResults split(double y)

splitAfter

public Segment splitAfter(double t)

splitBefore

public Segment splitBefore(double t)

subdivide

public void subdivide(Segment s0, Segment s1)
Subdivides this Linear segment into two segments 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 Linear segment into two segments 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(Linear l0, Linear l1)
Subdivides this Cubic curve into two curves at t = 0.5. Can be done with getSegment but this is more efficent.

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

subdivide

public void subdivide(double t, Linear l0, Linear l1)
Subdivides this Cubic curve into two curves. Can be done with getSegment but this is more efficent.

Parameters: t position to split the curve l0 if non-null contains portion of curve from 0->t l1 if non-null contains portion of curve from t->1

toString

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