jdsl.geomobj.ref
Class RatSegment2D
java.lang.Object
|
+--jdsl.geomobj.ref.AbstractGeomObject2D
|
+--jdsl.geomobj.ref.AbstractLinearCurve2D
|
+--jdsl.geomobj.ref.AbstractRatLinearCurve2D
|
+--jdsl.geomobj.ref.RatSegment2D
- All Implemented Interfaces:
- Curve2D, GeomObject, GeomObject2D, LinearCurve2D, OpenCurve2D, Segment2D
- public class RatSegment2D
- extends AbstractRatLinearCurve2D
- implements Segment2D
A Segment2D constructed using two distinct integer or rational
points.
- Version:
- $Id: RatSegment2D.java,v 1.4 2001/04/28 10:52:58 lv Exp $
- Author:
- Masi Oka (mao), Luca Vismara (lv)
Constructor Summary |
RatSegment2D(Point2D p1,
Point2D p2)
Creates a segment with endpoints p1 and p2; the underlying
direction is from p1 to p2. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RatSegment2D
public RatSegment2D(Point2D p1,
Point2D p2)
throws InvalidPointException
- Creates a segment with endpoints p1 and p2; the underlying
direction is from p1 to p2.
- Parameters:
p1
- one endpoint of the segment; must be an integer or a
rational pointp2
- the other endpoint of the segment; must be an integer
or rational point distinct from p1- Throws:
InvalidPointException
- if p1 and p2 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
bottomPoint
public Point2D bottomPoint()
- Specified by:
bottomPoint
in interface Segment2D
- Following copied from interface:
jdsl.geomobj.api.Segment2D
- Returns:
- the bottom endpoint of this; any endpoint if this is
horizontal
topPoint
public Point2D topPoint()
- Specified by:
topPoint
in interface Segment2D
- Following copied from interface:
jdsl.geomobj.api.Segment2D
- Returns:
- the top endpoint of this; any endpoint if this is
horizontal
leftPoint
public Point2D leftPoint()
- Specified by:
leftPoint
in interface Segment2D
- Following copied from interface:
jdsl.geomobj.api.Segment2D
- Returns:
- the leftmost endpoint of this; any endpoint if this is
vertical
rightPoint
public Point2D rightPoint()
- Specified by:
rightPoint
in interface Segment2D
- Following copied from interface:
jdsl.geomobj.api.Segment2D
- Returns:
- the rightmost endpoint of this; any endpoint if this is
vertical
supportingLine
public Line2D supportingLine()
- Specified by:
supportingLine
in interface Segment2D
- Following copied from interface:
jdsl.geomobj.api.Segment2D
- Returns:
- the line passing through the endpoints and with the same
direction of this