Class com.oroinc.math.geometry.Point
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.oroinc.math.geometry.Point

java.lang.Object
   |
   +----com.oroinc.math.geometry.Tuple
           |
           +----com.oroinc.math.geometry.Point

public final class Point
extends Tuple
A class derived from Tuple representing a point in homogeneous coordinates. Only Points with dimensions between 1 and 3 are supported. The class isn't named GeometricPoint or something other than Point because we feel this class will typically not be used at the same time as the java.awt package and java.awt.Point are used.

Copyright © 1996, 1997 Original Reusable Objects, Inc. All rights reserved.

Author:
Daniel F. Savarese

Constructor Index

 o Point()
Default constructor.
 o Point(float, float)
Creates a two dimensional Point.
 o Point(float, float, float)
Creates a three dimensional Point.
 o Point(int)
Creates a Point of a given dimension and initizlies all of its coordinates to 0.
 o Point(Tuple)
The Point copy constructor.

Method Index

 o assign(Point)
This is the assignment operator for Points.
 o clone()
Returns a deep copy of the Point.
 o setDimension(int)
Sets the dimension of the Point.

Constructors

 o Point
  public Point(Tuple tuple)
The Point copy constructor. Creates a new Point instance that is a deep copy of the argument. The programmer should exercise care in choosing what Tuple subclasses to pass as an argument.

Parameters:
tuple - The Tuple used to initialize the new Point.
 o Point
  public Point(int dimension)
Creates a Point of a given dimension and initizlies all of its coordinates to 0. Only dimensions 1 to 3 are supported and no check is made to ensure a valid argument was passed. It is the programmer's responsibility to use valid arguments.

Parameters:
dimension - The dimension of the new Point.
 o Point
  public Point()
Default constructor. Creates a Point of dimension 0 under the assumption that a subsequent call to setDimension(int) will be made.
 o Point
  public Point(float x,
               float y)
Creates a two dimensional Point.

Parameters:
x - The x coordinate.
y - The y coordinate.
 o Point
  public Point(float x,
               float y,
               float z)
Creates a three dimensional Point.

Parameters:
x - The x coordinate.
y - The y coordinate.
z - The z coordinate.

Methods

 o assign
  public void assign(Point point)
This is the assignment operator for Points. Assigns the value of the argument to the calling Point.

Parameters:
point - The value to assign to the Point.
 o clone
  public Object clone()
Returns a deep copy of the Point. Essentially just returns
new Point(this);

Returns:
A deep copy of the Point.
Overrides:
clone in class Tuple
 o setDimension
  public void setDimension(int dimension)
Sets the dimension of the Point. Only dimensions 1 to 3 are supported and no check is made to ensure a valid argument was passed. It is the programmer's responsibility to use valid arguments.

Parameters:
dimension - The new dimension of the Point.
Overrides:
setDimension in class Tuple

All Packages  Class Hierarchy  This Package  Previous  Next  Index