jdsl.geomobj.ref
Class RatRay2D
java.lang.Object
|
+--jdsl.geomobj.ref.AbstractGeomObject2D
|
+--jdsl.geomobj.ref.AbstractLinearCurve2D
|
+--jdsl.geomobj.ref.AbstractRatLinearCurve2D
|
+--jdsl.geomobj.ref.RatRay2D
- All Implemented Interfaces:
- Curve2D, GeomObject, GeomObject2D, LinearCurve2D, OpenCurve2D, Ray2D
- public class RatRay2D
- extends AbstractRatLinearCurve2D
- implements Ray2D
RatRay2D is a Ray2D constructed using either two distinct integer
or rational points, or an integer or rational point and an integer
or rational direction.
- Version:
- $Id: RatRay2D.java,v 1.6 2001/04/28 10:54:22 lv Exp $
- Author:
- Masi Oka (mao), Luca Vismara (lv)
Constructor Summary |
RatRay2D(Point2D source,
Direction2D dir)
Creates a ray emanating from point source with direction dir. |
RatRay2D(Point2D source,
Point2D other)
Creates a ray emanating from point source and passing through
point other; the underlying direction is from source to other. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RatRay2D
public RatRay2D(Point2D source,
Direction2D dir)
throws InvalidPointException,
InvalidDirectionException
- Creates a ray emanating from point source with direction dir.
- Parameters:
source
- the source of the ray; must be an integer or
rational pointdir
- the direction of the ray; must be an integer or
rational direction- Throws:
InvalidPointException
- if source is not an integer or
rational pointInvalidDirectionException
- if dir is not an integer or
rational direction
RatRay2D
public RatRay2D(Point2D source,
Point2D other)
throws InvalidPointException
- Creates a ray emanating from point source and passing through
point other; the underlying direction is from source to other.
- Parameters:
source
- the source of the ray; must be an integer or a
rational pointother
- another point of the ray; must be an integer or
rational point distinct from source- Throws:
InvalidPointException
- if source and other are not
integer or rational points, or if they are coincident
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
source
public Point2D source()
- Specified by:
source
in interface Ray2D
- Following copied from interface:
jdsl.geomobj.api.Ray2D
- Returns:
- the source point of this
other
public Point2D other()
- Specified by:
other
in interface Ray2D
- Following copied from interface:
jdsl.geomobj.api.Ray2D
- Returns:
- the non-source point of this
isDownward
public boolean isDownward()
- Specified by:
isDownward
in interface Ray2D
- Following copied from interface:
jdsl.geomobj.api.Ray2D
- Returns:
- whether this is directed downward, i.e., whether the
source point is the topmost point of this
isUpward
public boolean isUpward()
- Specified by:
isUpward
in interface Ray2D
- Following copied from interface:
jdsl.geomobj.api.Ray2D
- Returns:
- whether this is directed upward, i.e., whether the source
point is the bottommost point of this
isLeftward
public boolean isLeftward()
- Specified by:
isLeftward
in interface Ray2D
- Following copied from interface:
jdsl.geomobj.api.Ray2D
- Returns:
- whether this is directed leftward, i.e., whether the
source point is the rightmost point of this
isRightward
public boolean isRightward()
- Specified by:
isRightward
in interface Ray2D
- Following copied from interface:
jdsl.geomobj.api.Ray2D
- Returns:
- whether this is directed rightward, i.e., whether the
source point is the leftmost point of this
supportingLine
public Line2D supportingLine()
- Specified by:
supportingLine
in interface Ray2D
- Following copied from interface:
jdsl.geomobj.api.Ray2D
- Returns:
- the line passing through the source point and with the
same direction of this