Package lejos.robotics.geometry
Class Line2D.Float
- java.lang.Object
-
- lejos.robotics.geometry.Line2D
-
- lejos.robotics.geometry.Line2D.Float
-
-
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.voidsetLine(float x1, float y1, float x2, float y2)Set the float coordinates of the start and end of the line-
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
-
Float
public Float()
Creates a zero length line at (0,0)
-
Float
public Float(float x1, float y1, float x2, float y2)Create a line from (x1,y1) to (x2,y2)- 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
-
setLine
public void setLine(float x1, float y1, float x2, float y2)Set the float coordinates of the start and end of the line- 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
-
getBounds2D
public Rectangle2D getBounds2D()
Get the bounds of the line as a Rectangle2D- Returns:
- the bounding Rectangle2D
-
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.
-
-