jdsl.geomobj.ref
Class RealSegment2D
java.lang.Object
|
+--jdsl.geomobj.ref.AbstractGeomObject2D
|
+--jdsl.geomobj.ref.AbstractLinearCurve2D
|
+--jdsl.geomobj.ref.AbstractRealLinearCurve2D
|
+--jdsl.geomobj.ref.RealSegment2D
- All Implemented Interfaces:
- Curve2D, GeomObject, GeomObject2D, LinearCurve2D, OpenCurve2D, Segment2D
- public class RealSegment2D
- extends AbstractRealLinearCurve2D
- implements Segment2D
RealSegment2D is a Segment2D constructed using two distinct real
points.
- Version:
- $Id: RealSegment2D.java,v 1.1 2000/06/27 15:46:11 lv Exp $
- Author:
- Luca Vismara (lv)
Constructor Summary |
RealSegment2D(Point2D p1,
Point2D p2)
Creates a segment passing 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 |
RealSegment2D
public RealSegment2D(Point2D p1,
Point2D p2)
throws InvalidPointException
- Creates a segment passing with endpoints p1 and p2; the
underlying direction is from p1 to p2.
- Parameters:
p1
- one endpoint of the segment; must be a real pointp2
- the other endpoint of the segment; must be a real
point distinct from p1- Throws:
InvalidPointException
- if p1 and p2 are not real
points, or if p1 and p2 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