jdsl.geomobj.ref
Class IntRay2D
java.lang.Object
|
+--jdsl.geomobj.ref.AbstractGeomObject2D
|
+--jdsl.geomobj.ref.AbstractLinearCurve2D
|
+--jdsl.geomobj.ref.AbstractIntLinearCurve2D
|
+--jdsl.geomobj.ref.IntRay2D
- All Implemented Interfaces:
- Curve2D, GeomObject, GeomObject2D, LinearCurve2D, OpenCurve2D, Ray2D
- public class IntRay2D
- extends AbstractIntLinearCurve2D
- implements Ray2D
IntRay2D is a Ray2D constructed using either two distinct integer
points or an integer point and an integer direction.
- Version:
- $Id: IntRay2D.java,v 1.5 2001/05/16 13:44:58 lv Exp $
- Author:
- Masi Oka (mao), Luca Vismara (lv)
Constructor Summary |
IntRay2D(Point2D source,
Direction2D dir)
Creates a ray emanating from point source with direction dir. |
IntRay2D(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 |
IntRay2D
public IntRay2D(Point2D source,
Direction2D dir)
throws InvalidDirectionException,
InvalidPointException
- Creates a ray emanating from point source with direction dir.
- Parameters:
source
- the source of the ray; must be an integer pointdir
- the direction of the ray- Throws:
InvalidPointException
- if source is not an integer pointInvalidDirectionException
- if dir is not an integer direction
IntRay2D
public IntRay2D(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 pointother
- another point of the ray; must be an integer point
distinct from source- Throws:
InvalidPointException
- if source and other are not integer
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