jdsl.geomobj.ref
Class RatLine2D

java.lang.Object
  |
  +--jdsl.geomobj.ref.AbstractGeomObject2D
        |
        +--jdsl.geomobj.ref.AbstractLinearCurve2D
              |
              +--jdsl.geomobj.ref.AbstractRatLinearCurve2D
                    |
                    +--jdsl.geomobj.ref.RatLine2D
All Implemented Interfaces:
Curve2D, GeomObject, GeomObject2D, Line2D, LinearCurve2D, OpenCurve2D

public class RatLine2D
extends AbstractRatLinearCurve2D
implements Line2D

A Line2D constructed using either two distinct integer or rational points, or an integer or rational point and an integer or rational direction.

Version:
$Id: RatLine2D.java,v 1.5 2001/04/28 10:52:57 lv Exp $
Author:
Masi Oka (mao), Luca Vismara (lv)

Inner classes inherited from class jdsl.geomobj.api.GeomObject2D
GeomObject2D.NoneGeomObject2D
 
Fields inherited from class jdsl.geomobj.ref.AbstractRatLinearCurve2D
dir_, p1_, p2_
 
Fields inherited from class jdsl.geomobj.ref.AbstractLinearCurve2D
bottom_, INFINITE, left_, NEGATIVE, POSITIVE, right_, slope_, top_, ZERO
 
Fields inherited from class jdsl.geomobj.ref.AbstractGeomObject2D
gt, jn
 
Fields inherited from interface jdsl.geomobj.api.GeomObject2D
NONE
 
Constructor Summary
RatLine2D(Point2D p, Direction2D dir)
          Creates a line passing through point p with direction dir.
RatLine2D(Point2D p1, Point2D p2)
          Creates a line passing through points p1 and p2; the underlying direction is from p1 to p2.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 
Methods inherited from class jdsl.geomobj.ref.AbstractRatLinearCurve2D
arithmeticType, direction, points
 
Methods inherited from class jdsl.geomobj.ref.AbstractLinearCurve2D
isDecreasing, isHorizontal, isIncreasing, isVertical, toString
 
Methods inherited from class jdsl.geomobj.ref.AbstractGeomObject2D
dim
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jdsl.geomobj.api.LinearCurve2D
direction, isDecreasing, isHorizontal, isIncreasing, isVertical
 
Methods inherited from interface jdsl.geomobj.api.OpenCurve2D
points
 
Methods inherited from interface jdsl.geomobj.api.GeomObject
arithmeticType, dim
 

Constructor Detail

RatLine2D

public RatLine2D(Point2D p,
                 Direction2D dir)
          throws InvalidPointException,
                 InvalidDirectionException
Creates a line passing through point p with direction dir.
Parameters:
p - a point of the line; must be an integer or rational point
dir - the direction of the line curve; must be an integer or rational direction
Throws:
InvalidPointException - if p is not an integer or rational point
InvalidDirectionException - if dir is not an integer or rational direction

RatLine2D

public RatLine2D(Point2D p1,
                 Point2D p2)
          throws InvalidPointException
Creates a line passing through points p1 and p2; the underlying direction is from p1 to p2.
Parameters:
p1 - a point of the line; must be an integer or rational point
p2 - another point of the line; must be an integer or rational point distinct from p1
Throws:
InvalidPointException - if p1 and p2 are not integer or rational points, or if p1 and p2 are coincident
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object