public class Spiral2D extends AbstractShape
Spiral2D class defines a spiral shape.
This shape can be modeled by:
centerX+coilGap*(t+coilOffset)*Math.cos(2*Math.PI*t*m+angularOffset);
centerY+coilGap*(t+coilOffset)*Math.sin(2*Math.PI*t*m+angularOffset);
Spiral2DPathIterator
| Constructor and Description |
|---|
Spiral2D(double centerX, double centerY, double coilGap, double coils, double angularOffset, double coilOffset, boolean clockwise)
Creates a new
Spiral2D
|
Spiral2D(double centerX, double centerY, double coilGap, double coils, double angularOffset, double coilOffset, boolean clockwise, boolean outward)
Creates a new
Spiral2D
|
| Modifier and Type | Method and Description |
|---|---|
static Spiral2D |
createWithFixedCoilCount(double centerX, double centerY, double endX, double endY, double numCoils)
Creates a new
Spiral2D with a center point, an end point, and a fixed number of coils.
|
static Spiral2D |
createWithFixedCoilCount(Point2D
Creates a new
Spiral2D with a center point, an end point, and a fixed number of coils.
|
static Spiral2D |
createWithFixedCoilGap(double centerX, double centerY, double endX, double endY, double coilGap)
Creates a new
Spiral2D with a center point, an end point, and a fixed gap between coils.
|
static Spiral2D |
createWithFixedCoilGap(Point2D
Creates a new
Spiral2D with a center point, an end point, and a fixed gap between coils.
|
double |
getAngularOffset()
|
double |
getCenterX()
|
double |
getCenterY()
|
double |
getCoilGap()
|
double |
getCoilOffset()
|
double |
getCoils()
|
PathIterator |
getPathIterator(AffineTransform
|
int |
getWindingRule()
|
boolean |
isClockwise()
|
boolean |
isOutward()
|
void |
setAngularOffset(double v)
|
void |
setCenter(double centerX, double centerY)
|
void |
setClockwise(boolean b)
|
void |
setCoilGap(double coilGap)
|
void |
setCoilOffset(double v)
|
void |
setCoils(double coils)
|
void |
setOutward(boolean b)
|
contains, contains, contains, contains, contains, contains, contains, contains, countCrossings, getBounds, getBounds, getBounds, getBounds2D, getBounds2D, getPathIterator, identifyCrossings, intersects, intersects, intersectspublic Spiral2D(double centerX,
double centerY,
double coilGap,
double coils,
double angularOffset,
double coilOffset,
boolean clockwise)
Spiral2D
centerX - the x-coordinate of the center of this spiral.
centerY - the y-coordinate of the center of this spiral.
coilGap - the space between any two coils.
coils - the number of coils in this spiral.
angularOffset - the angle at the center of this spiral.
coilOffset - the space from the center of the spiral to where the path begins painting.
clockwise - whether this spiral moves clockwise or counterclockwise from the center.
public Spiral2D(double centerX,
double centerY,
double coilGap,
double coils,
double angularOffset,
double coilOffset,
boolean clockwise,
boolean outward)
Spiral2D
centerX - the x-coordinate of the center of this spiral.
centerY - the y-coordinate of the center of this spiral.
coilGap - the space between any two coils.
coils - the number of coils in this spiral.
angularOffset - the angle at the center of this spiral.
coilOffset - the space from the center of the spiral to where the path begins painting.
clockwise - whether this spiral moves clockwise or counterclockwise from the center.
outward - whether this spiral spins outward from the center, or inward toward the center. This argument only matters if you are going to study the
PathIterator this shape produces.
public static Spiral2DcreateWithFixedCoilGap(Point2D center, Point2D end, double coilGap)
Spiral2D with a center point, an end point, and a fixed gap between coils.
center - the center of this spiral.
end - the outer tip of the spiral.
coilGap - the gap between coils.
Spiral2D
public static Spiral2DcreateWithFixedCoilGap(double centerX, double centerY, double endX, double endY, double coilGap)
Spiral2D with a center point, an end point, and a fixed gap between coils.
centerX - the x-coordinate of the center of the spiral.
centerY - the y-coordinate of the center of the spiral.
endX - the x-coordinate of the outer tip of the spiral.
endY - the y-coordinate of the outer tip of the spiral.
coilGap - the gap between coils.
Spiral2D
public static Spiral2DcreateWithFixedCoilCount(Point2D center, Point2D end, double numCoils)
Spiral2D with a center point, an end point, and a fixed number of coils.
center - the center of the spiral.
end - the outer tip of the spiral.
numCoils - the number of coils in this spiral.
Spiral2D
public static Spiral2DcreateWithFixedCoilCount(double centerX, double centerY, double endX, double endY, double numCoils)
Spiral2D with a center point, an end point, and a fixed number of coils.
centerX - the x-coordinate of the center of the spiral.
centerY - the y-coordinate of the center of the spiral.
endX - the x-coordinate of the outer tip of the spiral.
endY - the y-coordinate of the outer tip of the spiral.
numCoils - the number of coils in the spiral.
Spiral2D
public void setOutward(boolean b)
public boolean isOutward()
public double getCenterX()
public boolean isClockwise()
public double getCenterY()
public double getCoilGap()
public double getCoils()
public void setAngularOffset(double v)
public double getAngularOffset()
public void setCoilOffset(double v)
public double getCoilOffset()
public void setClockwise(boolean b)
public void setCenter(double centerX,
double centerY)public void setCoilGap(double coilGap)
public void setCoils(double coils)
public int getWindingRule()
public PathIteratorgetPathIterator(AffineTransform at)