com.partnersoft.geometry.xy
Class XyRay

java.lang.Object
  extended by com.partnersoft.geometry.xy.XyRay
All Implemented Interfaces:
Immutable

public class XyRay
extends java.lang.Object
implements Immutable

A ray in (x, y) space.

Rays begin at a point and extend infinitely far in a single direction. You can think of them as a "half" line, since you can place a point arbitrarily along a run and split it into two rays going in opposite directions.

Copyright 2007 Partner Software, Inc.

Version:
$Id: XyLine.java 988 2007-11-08 18:46:47Z paul $
Author:
Paul Reavis

Constructor Summary
XyRay(XyPoint point, XyDirection direction)
          Construct a ray from the given point and direction.
 
Method Summary
 XyDirection getDirection()
           
 XyLine getLine()
          Returns the line this ray forms a portion of.
 XyPoint getPoint()
           
 XyVector toUnitVector()
          Returns a unit vector with the same direction as this ray.
 XyRay withDirection(XyDirection newDirection)
           
 XyRay withPoint(XyPoint newPoint)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XyRay

public XyRay(XyPoint point,
             XyDirection direction)
Construct a ray from the given point and direction.

Method Detail

withPoint

public XyRay withPoint(XyPoint newPoint)

withDirection

public XyRay withDirection(XyDirection newDirection)

toUnitVector

public XyVector toUnitVector()
Returns a unit vector with the same direction as this ray.


getPoint

public XyPoint getPoint()

getDirection

public XyDirection getDirection()

getLine

public XyLine getLine()
Returns the line this ray forms a portion of.