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.


Variable Index

 o x
 o y

Constructor Index

 o PointList()
Creates an empty PointList.
 o 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.
 o 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.
 o PointList(int)
Creates an PointList containing npoints unspecified points.

Method Index

 o add(double, double)
Appends a point to the list.
 o print()
Prints the points in the list to standard out.
 o print(int, int, int, int)
Formats and prints the points in the list to standard out.
 o print(int, int, int, int, int)
Formats and prints the first nopoints in the list to standard out.
 o toFile(String, int, int, int, int)
Formats and prints the points in the list to a file.
 o toFile(String, int, int, int, int, int)
Formats and prints the points in the list to a file.
 o transform(double[][])
Applies the affine linear map determined by the 2x3 matrix of the argument to all points in the list.

Variables

 o x
 public double x[]
 o y
 public double y[]

Constructors

 o PointList
 public PointList()
Creates an empty PointList.

 o PointList
 public PointList(int npoints)
Creates an PointList containing npoints unspecified points.

 o 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.

 o 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.

Methods

 o add
 public void add(double xx,
                 double yy)
Appends a point to the list.

 o 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] ; 

 o print
 public void print()
Prints the points in the list to standard out.

 o 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.
 o 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.
 o 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.
 o 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