math.geom2d.line
Class Ray2D

java.lang.Object
  extended by math.geom2d.line.StraightObject2D
      extended by math.geom2d.line.LineArc2D
          extended by math.geom2d.line.Ray2D
All Implemented Interfaces:
java.awt.Shape, ContinuousCurve2D, ContinuousOrientedCurve2D, Curve2D, OrientedCurve2D, SmoothCurve2D, SmoothOrientedCurve2D, Shape2D

public class Ray2D
extends LineArc2D

Ray, or half-line, defined from an origin and a direction vector. It is composed of all points satisfying the parametric equation:

x(t) = x0+t*dx
y(t) = y0+t*dy

With t comprised between 0 and +INFINITY.


Field Summary
 
Fields inherited from class math.geom2d.line.LineArc2D
t0, t1
 
Fields inherited from class math.geom2d.line.StraightObject2D
dx, dy, x0, y0
 
Fields inherited from interface math.geom2d.curve.ContinuousCurve2D
CIRCLE, CLOSED_EDGE, LOOP, OPEN_EDGE
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY, defaultClipWindow, EMPTY_SET
 
Constructor Summary
Ray2D()
          Empty constructor for Ray2D.
Ray2D(double x, double y, double angle)
          Creates a new Ray2D, originating from point (x, y)<\code>, and going in the direction specified by angle<\code> (in radians).
Ray2D(double x1, double y1, double dx, double dy)
          Creates a new Ray2D, originating from point (x1,y1)<\code>, and going in the direction defined by vector (dx, dy)<\code>.
Ray2D(Point2D point, double angle)
          Creates a new Ray2D, originating from point point<\code>, and going in the direction specified by angle<\code> (in radians).
Ray2D(Point2D point, double dx, double dy)
          Creates a new Ray2D, originating from point point<\code>, and going in the direction defined by vector (dx,dy)<\code>.
Ray2D(Point2D point1, Point2D point2)
          Creates a new Ray2D, originating from point1<\code>, and going in the direction of point2<\code>.
Ray2D(Point2D point, Vector2D vector)
          Creates a new Ray2D, originating from point point<\code>, and going in the direction specified by vector<\code>.
Ray2D(StraightObject2D line)
          Define a new Ray, with same characteristics as given object.
 
Method Summary
 boolean isBounded()
          Always returns false, because a ray is not bounded.
 void setRay(double x0, double y0, double dx, double dy)
           
 void setRay(Point2D p1, Point2D p2)
           
 void setRay(Point2D point, Vector2D vect)
           
 LineArc2D transform(AffineTransform2D trans)
          Transforms the curve by an affine transform.
 
Methods inherited from class math.geom2d.line.LineArc2D
appendPath, clip, contains, contains, equals, equals, getAsPolyline, getBoundingBox, getBounds, getBounds2D, getContinuousCurves, getCurvature, getDistance, getDistance, getFirstPoint, getInnerPath, getLastPoint, getLength, getPathIterator, getPathIterator, getPoint, getPoint, getPoint1, getPoint2, getPosition, getReverseCurve, getSmoothPieces, getSubCurve, getT0, getT1, getTangent, getWindingAngle, getX1, getX2, getY1, getY2, intersects, intersects, isInside, project, toString
 
Methods inherited from class math.geom2d.line.StraightObject2D
contains, contains, getCartesianEquation, getDistance, getHorizontalAngle, getIntersection, getIntersection, getIntersections, getOrigin, getParallel, getParametric, getPerpendicular, getPolarCoefficients, getPositionOnLine, getPositionOnLine, getProjectedPoint, getProjectedPoint, getSignedDistance, getSignedDistance, getSignedPolarCoefficients, getSupportLine, getSymmetric, getSymmetric, getVector, isClosed, isColinear, isColinear, isInside, isParallel, isParallel
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D
isClosed
 
Methods inherited from interface math.geom2d.curve.OrientedCurve2D
getSignedDistance, getSignedDistance
 
Methods inherited from interface math.geom2d.curve.Curve2D
getIntersections
 
Methods inherited from interface java.awt.Shape
contains, contains
 

Constructor Detail

Ray2D

public Ray2D()
Empty constructor for Ray2D. Default is ray starting at origin, and having a slope of 1*dx and 0*dy.


Ray2D

public Ray2D(Point2D point1,
             Point2D point2)
Creates a new Ray2D, originating from point1<\code>, and going in the direction of point2<\code>.


Ray2D

public Ray2D(double x1,
             double y1,
             double dx,
             double dy)
Creates a new Ray2D, originating from point (x1,y1)<\code>, and going in the direction defined by vector (dx, dy)<\code>.


Ray2D

public Ray2D(Point2D point,
             double dx,
             double dy)
Creates a new Ray2D, originating from point point<\code>, and going in the direction defined by vector (dx,dy)<\code>.


Ray2D

public Ray2D(Point2D point,
             Vector2D vector)
Creates a new Ray2D, originating from point point<\code>, and going in the direction specified by vector<\code>.


Ray2D

public Ray2D(Point2D point,
             double angle)
Creates a new Ray2D, originating from point point<\code>, and going in the direction specified by angle<\code> (in radians).


Ray2D

public Ray2D(double x,
             double y,
             double angle)
Creates a new Ray2D, originating from point (x, y)<\code>, and going in the direction specified by angle<\code> (in radians).


Ray2D

public Ray2D(StraightObject2D line)
Define a new Ray, with same characteristics as given object.

Method Detail

setRay

public void setRay(double x0,
                   double y0,
                   double dx,
                   double dy)

setRay

public void setRay(Point2D p1,
                   Point2D p2)

setRay

public void setRay(Point2D point,
                   Vector2D vect)

isBounded

public boolean isBounded()
Always returns false, because a ray is not bounded.

Specified by:
isBounded in interface Shape2D
Overrides:
isBounded in class LineArc2D

transform

public LineArc2D transform(AffineTransform2D trans)
Description copied from interface: Curve2D
Transforms the curve by an affine transform. The result is an instance of Curve2D.

Specified by:
transform in interface ContinuousCurve2D
Specified by:
transform in interface ContinuousOrientedCurve2D
Specified by:
transform in interface Curve2D
Specified by:
transform in interface OrientedCurve2D
Specified by:
transform in interface SmoothCurve2D
Specified by:
transform in interface SmoothOrientedCurve2D
Specified by:
transform in interface Shape2D
Overrides:
transform in class LineArc2D
Parameters:
trans - an affine transform
Returns:
the transformed shape