Class EDU.emporia.mathtools.PolygonalCurve
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.emporia.mathtools.PolygonalCurve

Object
   |
   +----ParametricCurve
           |
           +----EDU.emporia.mathtools.PolygonalCurve

public class PolygonalCurve
extends ParametricCurve
This creates a parameterized polygonal curve whose graph is a series of line segments between specified points

Version:
1.0
Author:
Joe Yanik
Since:
7/9/00

Variable Index

 o points
The vector of points that define the polygonal curve

Constructor Index

 o EDU.emporia.mathtools.PolygonalCurve()
no-argument constructor

Method Index

 o addPoint(Point2D.Double)
Adds a point to be used to construct the polygon
 o addPoint(double, double)
Adds a point to be used to construct the polygon
 o addPoints(Point2D.Double[])
Adds an array of points to be used to define the polygon
 o clearPoints()
 o getPoint(double)
Returns the point correponding to the specified index
 o getPoints()
Gets the array of points that are being used to define the curve
 o removeAllPoints()
Clears all the points out to go back to an empty curve.
 o removePoint(Point2D.Double)
Removes the point from the list of points to be used
 o removePoint(double, double)
Removes the point from the list of points to be used

Variables

 o points
public java.util.Vector points
The vector of points that define the polygonal curve

Constructors

 o PolygonalCurve
public PolygonalCurve()
no-argument constructor

Methods

 o addPoint
public void addPoint(EDU.emporia.mathtools.Point2D.Double p)
Adds a point to be used to construct the polygon

Parameters:
p - The point to be added
 o addPoint
public void addPoint(double x,
                     double y)
Adds a point to be used to construct the polygon

Parameters:
x - The x-coordinate of the point
y - The y-coordinate of the point
 o addPoints
public void addPoints(EDU.emporia.mathtools.Point2D.Double[] p)
Adds an array of points to be used to define the polygon

Parameters:
p - The array of points
 o clearPoints
public void clearPoints()
 o getPoint
public EDU.emporia.mathtools.Point2D getPoint(double u)
Returns the point correponding to the specified index

Parameters:
u - The index of the point.
Returns:
The point at that index. If the index is outside the bounds of the defined point it returns a point both of whose coordinates are Double.NaN
Overrides:
getPoint in class ParametricCurve
 o getPoints
public EDU.emporia.mathtools.Point2D.Double[] getPoints()
Gets the array of points that are being used to define the curve

 o removeAllPoints
public void removeAllPoints()
Clears all the points out to go back to an empty curve.

 o removePoint
public void removePoint(EDU.emporia.mathtools.Point2D.Double p)
Removes the point from the list of points to be used

Parameters:
p - The point to be removed
 o removePoint
public void removePoint(double x,
                        double y)
Removes the point from the list of points to be used

Parameters:
x - The x-coordinate of the point to be used
y - The y-coordinate of the point to be used

All Packages  Class Hierarchy  This Package  Previous  Next  Index