Package evo.search.view.render
Class Ray2D
- java.lang.Object
-
- java.awt.geom.Line2D
-
- java.awt.geom.Line2D.Double
-
- evo.search.view.render.Ray2D
-
- All Implemented Interfaces:
Shape
,Serializable
,Cloneable
public class Ray2D extends Line2D.Double
Infinite 2d ray. First point marks the origin and the second the direction.- See Also:
- Serialized Form
-
-
Nested 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
Constructors Constructor Description Ray2D(double x1, double y1, double x2, double y2)
Two-point-coordinate constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Line2D
render(double distance)
Render the ray as a scaled line.-
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
-
-
-
-
Constructor Detail
-
Ray2D
public Ray2D(double x1, double y1, double x2, double y2)
Two-point-coordinate constructor. The direction is relative to the origin. The ray goes through both points.- Parameters:
x1
- x-coordinate of originy1
- y-coordinate of originx2
- x-coordinate of directiony2
- y-coordinate of direction
-
-
Method Detail
-
render
public Line2D render(double distance)
Render the ray as a scaled line.- Parameters:
distance
- scaling factor to render the line- Returns:
- a line simulating an infinite ray
-
-