Class XLine2D
- java.lang.Object
-
- net.sourceforge.plantuml.klimt.geom.XLine2D
-
-
Constructor Summary
Constructors Constructor Description XLine2D(double x1, double y1, double x2, double y2)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drawU(UGraphic ug)
double
getAngle()
XPoint2D
getMiddle()
XPoint2D
getP1()
XPoint2D
getP2()
double
getX1()
double
getX2()
double
getY1()
double
getY2()
XPoint2D
intersect(XLine2D line2)
static XLine2D
line(XPoint2D p1, XPoint2D p2)
static double
ptSegDistSq(double x1, double y1, double x2, double y2, double px, double py)
Returns the square of the distance from a point to a line segment.XLine2D
withPoint1(XPoint2D other)
XLine2D
withPoint2(XPoint2D other)
-
-
-
Method Detail
-
getMiddle
public XPoint2D getMiddle()
-
getX1
public final double getX1()
-
getY1
public final double getY1()
-
getX2
public final double getX2()
-
getY2
public final double getY2()
-
getP1
public XPoint2D getP1()
-
getP2
public XPoint2D getP2()
-
ptSegDistSq
public static double ptSegDistSq(double x1, double y1, double x2, double y2, double px, double py)
Returns the square of the distance from a point to a line segment. The distance measured is the distance between the specified point and the closest point between the specified end points. If the specified point intersects the line segment in between the end points, this method returns 0.0.- Parameters:
x1
- the X coordinate of the start point of the specified line segmenty1
- the Y coordinate of the start point of the specified line segmentx2
- the X coordinate of the end point of the specified line segmenty2
- the Y coordinate of the end point of the specified line segmentpx
- the X coordinate of the specified point being measured against the specified line segmentpy
- the Y coordinate of the specified point being measured against the specified line segment- Returns:
- a double value that is the square of the distance from the specified point to the specified line segment.
- Since:
- 1.2
-
getAngle
public double getAngle()
-
-