Class SineStarFactory

Hierarchy: Object , GeometricShapeFactory, SineStarFactory
public class SineStarFactory
extends GeometricShapeFactory
Creates geometries which are shaped like multi-armed stars with each arm shaped like a sine wave. These kinds of geometries are useful as a more complex geometry for testing algorithms.
Authors:
Martin Davis
public SineStarFactory()
Creates a factory which will create sine stars using the default GeometryFactory.
public SineStarFactory(GeometryFactory geomFact)
Creates a factory which will create sine stars using the given GeometryFactory.
Parameters:
geomFact - geomFact the factory to use
public static Geometry create(Coordinate origin, double size, int nPts, int nArms, double armLengthRatio)
Creates a sine star with the given parameters.
Parameters:
origin - origin the origin point
size - size the size of the star
nPts - nPts the number of points in the star
nArms - nArms the number of arms to generate
armLengthRatio - armLengthRatio the arm length ratio
Returns:
a sine star shape
public void setNumArms(int numArms)
Sets the number of arms in the star
Parameters:
numArms - numArms the number of arms to generate
public void setArmLengthRatio(double armLengthRatio)
Sets the ratio of the length of each arm to the radius of the star. A smaller number makes the arms shorter. Value should be between 0.0 and 1.0
Parameters:
armLengthRatio - armLengthRatio the ratio determining the length of them arms.
public Geometry createSineStar()
Generates the geometry for the sine star
Returns:
the geometry representing the sine star