|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Line2D
java.awt.geom.Line2D.Double
de.unihalle.informatik.MiToBo.core.datatypes.MTBLineSegment2D
@ALDMetaInfo(export=ALLOWED) public class MTBLineSegment2D
Enhanced 2D line segments.
This class adds some useful functions to Line2D.Double
,
mostly concerning geometrical calculations like intersections, orientations,
scalar products and distances.
Line2D.Double
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Line2D |
---|
Line2D.Double, Line2D.Float |
Field Summary |
---|
Fields inherited from class java.awt.geom.Line2D.Double |
---|
x1, x2, y1, y2 |
Constructor Summary | |
---|---|
MTBLineSegment2D(double X1,
double Y1,
double X2,
double Y2)
Constructor. |
Method Summary | |
---|---|
boolean |
containsPoint(double px,
double py)
Checks if a given point is part of the segment. |
Point2D.Double |
getIntersection(MTBLineSegment2D ls)
Calculates the point of intersection between the segments. |
double |
getNorm()
Calculates the Euclidean norm of the segment. |
double |
getOrientation(double px,
double py)
Deprecated. |
double |
getPointDist(double x,
double y)
Deprecated. |
double |
scalprod(MTBLineSegment2D ls)
Calculates the scalar product of the given segment to this one. |
Methods inherited from class java.awt.geom.Line2D.Double |
---|
getBounds2D, getP1, getP2, getX1, getX2, getY1, getY2, setLine |
Methods inherited from class java.awt.geom.Line2D |
---|
clone, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MTBLineSegment2D(double X1, double Y1, double X2, double Y2)
X1
- x-coordinate of first point.Y1
- y-coordinate of first point.X2
- x-coordinate of second point.Y2
- y-coordinate of second point.Method Detail |
---|
public double scalprod(MTBLineSegment2D ls)
The segments are interpreted as vectors, directed from the first point of the segment to the second.
ls
- Input line segment.
public double getNorm()
public boolean containsPoint(double px, double py)
px
- x-coordinate of the point.py
- y-coordinate of the point.
@Deprecated public double getPointDist(double x, double y)
@Deprecated public double getOrientation(double px, double py)
If return value is positive, point lies left of the segment, if it is negative, the point is located on the right. If the return value is zero, the point is located on the segment or at least on the line to which the segment belongs to.
px
- x-coordinate of the point.py
- y-coordinate of the point.
public Point2D.Double getIntersection(MTBLineSegment2D ls)
ls
- Line segment to be checked.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |