All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openstar.util.Point

java.lang.Object
   |
   +----openstar.util.Point

public class Point
extends Object
implements Transformable
A class representing points in the n-dimensional euclidean space.

Version:
09 Apr 1997
Author:
Nils Schwabe

Variable Index

 o equalityTreshold
Interval in which two coordinate values are treated as beeing equal.

Constructor Index

 o Point(double, double)
Constructs a 2-D point with specified coordinates.
 o Point(double, double, double)
Constructs a 3-D point with specified coordinates.
 o Point(int)
Constructs a new n-dimensional point.

Method Index

 o assign(Point)
Assigns the coordinate values of another point to this point.
 o clone()
Makes a deep copy of this point.
 o equals(Object)
 o get(int)
Gets the coordinate value for a given dimension.
 o getDim()
Returns the number of dimensions of this point.
 o set(int, double)
Sets the coordinate value for a given dimension.
 o toString()
 o transform(Transformation)
Transforms this point.

Variables

 o equalityTreshold
  public double equalityTreshold
Interval in which two coordinate values are treated as beeing equal.

Constructors

 o Point
  public Point(int dimensions)
Constructs a new n-dimensional point.

Parameters:
dimensions - number of dimensions
 o Point
  public Point(double x,
               double y)
Constructs a 2-D point with specified coordinates.

Parameters:
x - first coordinate
y - second coordinate
 o Point
  public Point(double x,
               double y,
               double z)
Constructs a 3-D point with specified coordinates.

Parameters:
x - first coordinate
y - second coordinate

Methods

 o clone
  public Object clone()
Makes a deep copy of this point.

Overrides:
clone in class Object
 o assign
  public void assign(Point p)
Assigns the coordinate values of another point to this point. Dimension conflicts are ignored, i.e. if the other point has too many coordinates then they are ignored, or the remaining coordinates of this point are set to 0.

 o toString
  public String toString()
Overrides:
toString in class Object
 o equals
  public boolean equals(Object obj)
Overrides:
equals in class Object
 o get
  public double get(int index)
Gets the coordinate value for a given dimension.

Parameters:
index - zero-based index (0.0 is returned if the index is too big)
 o set
  public void set(int index,
                  double newVal)
Sets the coordinate value for a given dimension.

Parameters:
index - zero-based index (ignored if the index is too big)
newVal - new value
 o getDim
  public int getDim()
Returns the number of dimensions of this point.

 o transform
  public void transform(Transformation t)
Transforms this point.


All Packages  Class Hierarchy  This Package  Previous  Next  Index