geometry
Class CoordPlane

java.lang.Object
  extended bygeometry.AffineSpace
      extended bygeometry.Plane
          extended bygeometry.CoordPlane
All Implemented Interfaces:
Geometry

public class CoordPlane
extends Plane

A plane which is parallel to two coordinate vectors. The methods for such a plane are much simpler than in the arbitrary case.

Author:
karsten

Field Summary
protected  double scaling
          1/length of the two base vectors
protected  int xCoord
          The number of the first coordinate vector
protected  int yCoord
          The number of the second coordinate vector
 
Fields inherited from class geometry.AffineSpace
origin, space
 
Constructor Summary
CoordPlane(Point origin, int xCoord, int yCoord)
          Constructs a new plane from a point and two unit coordinate vectors.
CoordPlane(Point origin, int xCoord, int yCoord, double scale)
          Constructs a new plane from a point and two coordinate vectors of equal length.
 
Method Summary
 boolean contains(Point p)
           
 double getScaling()
          Returns 1/length of the two base vectors
 int getXCoord()
          Returns the number of the first coordinate vector
 int getYCoord()
          Returns the number of the second coordinate vector
 java.awt.geom.Point2D localProjection(Point p)
          Returns the image of the specified point after projecting it orthogonally to the plane (in local coordinates).
 
Methods inherited from class geometry.Plane
getX, getY
 
Methods inherited from class geometry.AffineSpace
add, add, affineClosure, canBeContainedIn, canContain, canIntersect, contains, contains, copy, dim, getGenerator, getNormal, getOrigin, getRandomRay, intersection, isContainedIn, localization, localization, outerDim, print, project, toShape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xCoord

protected int xCoord
The number of the first coordinate vector


yCoord

protected int yCoord
The number of the second coordinate vector


scaling

protected double scaling
1/length of the two base vectors

Constructor Detail

CoordPlane

public CoordPlane(Point origin,
                  int xCoord,
                  int yCoord)
Constructs a new plane from a point and two unit coordinate vectors. The two vectors will become the base vectors for the local coordinate system.

Parameters:
origin - any point in the plane

CoordPlane

public CoordPlane(Point origin,
                  int xCoord,
                  int yCoord,
                  double scale)
Constructs a new plane from a point and two coordinate vectors of equal length. The two vectors will become the base vectors for the local coordinate system.

Parameters:
origin - any point in the plane
Method Detail

getXCoord

public int getXCoord()
Returns the number of the first coordinate vector


getYCoord

public int getYCoord()
Returns the number of the second coordinate vector


getScaling

public double getScaling()
Returns 1/length of the two base vectors


contains

public boolean contains(Point p)

localProjection

public java.awt.geom.Point2D localProjection(Point p)
Description copied from class: Plane
Returns the image of the specified point after projecting it orthogonally to the plane (in local coordinates).

Overrides:
localProjection in class Plane
Parameters:
p - any point
Returns:
the coordinates of the projection of p in the local coordinate system.