All Packages Class Hierarchy This Package Previous Next Index
Class figPac.PointList
java.lang.Object
|
+----java.awt.Polygon
|
+----figPac.PointList
- public class PointList
- extends Polygon
A PointList is just a list of points, with a point being an array
of two doubles. Eventually, this will be extended to allow for points
in more than two dimensions.
-
x
-
-
y
-
-
PointList()
- Creates an empty PointList.
-
PointList(double[], double[], int)
- Creates an PointList containing npoints points whose x coordinates
are given in the first argument and whose y coordinates are given in the
second argument.
-
PointList(double[][], int)
- Creates an PointList containing npoints points whose x and y coordinates
are given as a two dimensional array in the first argument.
-
PointList(int)
- Creates an PointList containing npoints unspecified points.
-
add(double, double)
- Appends a point to the list.
-
print()
- Prints the points in the list to standard out.
-
print(int, int, int, int)
- Formats and prints the points in the list to standard out.
-
print(int, int, int, int, int)
- Formats and prints the first nopoints in the list to standard out.
-
toFile(String, int, int, int, int)
- Formats and prints the points in the list to a file.
-
toFile(String, int, int, int, int, int)
- Formats and prints the points in the list to a file.
-
transform(double[][])
- Applies the affine linear map determined by the 2x3
matrix of the argument to all points in the list.
x
public double x[]
y
public double y[]
PointList
public PointList()
- Creates an empty PointList.
PointList
public PointList(int npoints)
- Creates an PointList containing npoints unspecified points.
PointList
public PointList(double x[],
double y[],
int npoints)
- Creates an PointList containing npoints points whose x coordinates
are given in the first argument and whose y coordinates are given in the
second argument.
PointList
public PointList(double xy[][],
int npoints)
- Creates an PointList containing npoints points whose x and y coordinates
are given as a two dimensional array in the first argument.
add
public void add(double xx,
double yy)
- Appends a point to the list.
transform
public void transform(double tm[][])
- Applies the affine linear map determined by the 2x3
matrix of the argument to all points in the list. The new x and y
coordinates of each point are
oldx*tm[0][0]+oldy*tm[0][1]+tm[0][2] ;
oldx*tm[1][0]+oldy*tm[1][1]+tm[1][2] ;
print
public void print()
- Prints the points in the list to standard out.
print
public void print(int xwidth,
int xprecision,
int ywidth,
int yprecision)
- Formats and prints the points in the list to standard out.
- Parameters:
- xwidth - The minimum length of the formatted string for x.
- xprecision - The number of digits to follow the decimal point in x.
- ywidth - The minimum length of the formatted string for y.
- yprecision - The number of digits to follow the decimal point in y.
print
public void print(int xwidth,
int xprecision,
int ywidth,
int yprecision,
int nopoints)
- Formats and prints the first nopoints in the list to standard out.
- Parameters:
- xwidth - The minimum length of the formatted string for x.
- xprecision - The number of digits to follow the decimal point in x.
- ywidth - The minimum length of the formatted string for y.
- yprecision - The number of digits to follow the decimal point in y.
- nopoints - The number of points to be output.
toFile
public void toFile(String file,
int xwidth,
int xprecision,
int ywidth,
int yprecision)
- Formats and prints the points in the list to a file. Any attempt to use this method in an applet will be rejected with a security exception.
- Parameters:
- file - The file name.
- xwidth - The minimum length of the formatted string for x.
- xprecision - The number of digits to follow the decimal point in x.
- ywidth - The minimum length of the formatted string for y.
- yprecision - The number of digits to follow the decimal point in y.
toFile
public void toFile(String file,
int xwidth,
int xprecision,
int ywidth,
int yprecision,
int nopoints)
- Formats and prints the points in the list to a file. Any attempt to use this method in an applet will be rejected with a security exception.
- Parameters:
- file - The file name.
- xwidth - The minimum length of the formatted string for x.
- xprecision - The number of digits to follow the decimal point in x.
- ywidth - The minimum length of the formatted string for y.
- yprecision - The number of digits to follow the decimal point in y.
- nopoints - The number of points to be output.
All Packages Class Hierarchy This Package Previous Next Index