Package lejos.robotics.geometry
Class Line2D.Double
- java.lang.Object
-
- lejos.robotics.geometry.Line2D
-
- lejos.robotics.geometry.Line2D.Double
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class lejos.robotics.geometry.Line2D
Line2D.Double, Line2D.Float
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rectangle2DgetBounds2D()Get the bounds of the line as a Rectangle2DPoint2DgetP1()Get the start point of the line as a Point2DPoint2DgetP2()Get the end point of the line as a Point2DdoublegetX1()Get the x coordinate of the start of the linedoublegetX2()Get the x coordinate of the end of the linedoublegetY1()Get the y coordinate of the start of the linedoublegetY2()Get the y coordinate of the end of the linevoidsetLine(double x1, double y1, double x2, double y2)Sets the end points of the line using double coordinates.-
Methods inherited from class lejos.robotics.geometry.Line2D
clone, contains, contains, contains, contains, getBounds, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine
-
-
-
-
Constructor Detail
-
Double
public Double()
Create a zero length line at (0,0) with double coordinates
-
Double
public Double(double x1, double y1, double x2, double y2)Create a line from (x1,y1) to (x2,y2) with double coordinate- Parameters:
x1- the x coordinate of the start of the liney1- the y coordinate of the start of the linex2- the x coordinate of the end of the liney2- the y coordinate of the end of the line
-
-
Method Detail
-
getX1
public double getX1()
Description copied from class:Line2DGet the x coordinate of the start of the line
-
getY1
public double getY1()
Description copied from class:Line2DGet the y coordinate of the start of the line
-
getP1
public Point2D getP1()
Description copied from class:Line2DGet the start point of the line as a Point2D
-
getX2
public double getX2()
Description copied from class:Line2DGet the x coordinate of the end of the line
-
getY2
public double getY2()
Description copied from class:Line2DGet the y coordinate of the end of the line
-
getP2
public Point2D getP2()
Description copied from class:Line2DGet the end point of the line as a Point2D
-
setLine
public void setLine(double x1, double y1, double x2, double y2)Description copied from class:Line2DSets the end points of the line using double coordinates.
-
getBounds2D
public Rectangle2D getBounds2D()
Get the bounds of the line as a Rectangle2D- Returns:
- the bounding Rectangle2D
-
-