optics
Class ParaxialRay

java.lang.Object
  extended by optics.Optics
      extended by optics.Ray
          extended by optics.ParaxialRay
Direct Known Subclasses:
GaussianBeam

public class ParaxialRay
extends Ray

Class to implement ParaxialRays for Matrix Ray Tracing with a ParaxialRay being characterised by it height from the optical axis, its angle from the optical axis (in radians) and the position, or plane, along the optical axis. The position of the plane is in global coordinates. The wavelength is also inherited from Ray which defaults to Constants.GREEN.


Field Summary
protected  double angle
          Angle wrt to optical axis in radians
protected  double height
          Height of the ray
protected  double plane
          Plane of the rays, being distance along optical axis
 
Fields inherited from class optics.Ray
intensity, monitor, waveLength
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS
 
Constructor Summary
ParaxialRay()
          Default construct for ParaxialRay with height, angle all plane att set to zero.
ParaxialRay(double h, double a)
          Constructor for paraxial ray at specified height and angle in plane at position zero.
ParaxialRay(double h, double a, double p)
          Constructor for ParaxialRay at specified height, angle and plane.
ParaxialRay(double h, double p, double h1, double p1)
          Constructor to for a ray of height h in plane p towards height h1 in plane p1.
ParaxialRay(ParaxialRay r)
          Constructor for a ParaxialRay with parameters, including wavelength, but not the RayMonitor set by specified ParaxialRay.
 
Method Summary
 ParaxialRay clone()
          Method to return a clone (copy) of the current ParaxialRay.
 double crosses(ParaxialRay r)
          Method to calculate where the given ray will cross the current ray.
 double crossesZero()
          Method to calculate where the ray will intersect the optical axis in global coordinates.
 void edit()
          Method to invoke the RayEditor.
 double getAngle()
          Method to get the ray angle in radians.
 double getAngleInDegrees()
          Method to get the ray angle in degrees.
 double getHeight()
          Method to get the ray height
 double getPlane()
          Method to get the ray plane in global coordinates.
 Position getPosition()
          Method get the three dimensional Position of the Ray being (0.0,height,plane).
 double heightInPlane(double p)
          Method to calculate the height of the ray in the specified plane.
 boolean isInvalid()
          Method to test if a ray has been set invalid.
 boolean mult(ParaxialMatrix p)
          Method to pre-multiply the current ray by a ParaxialMatrix.
 javax.vecmath.Point2d pointInPlane(double plane)
          Method to calculate the point where this ray will intersect a x/y plane specified by it location on the optical z-axis.
 boolean propagate(double distance)
          Method to propagate a ray a specified distance along the optical axis without using the matrix scheme.
 boolean propagateThrough(ParaxialGroup g)
          Method to propagate a ray through an ParaxialGroup.
 int propagateThrough(ParaxialSystem s)
          Method to propagate the ray through a ParaxialSystem which consists of a number of ParaxialGroups.
 boolean propagateTo(double p)
          Method to propagate a ray to a specified plane.
 void setAngle(double a)
          Method to set the ray angle in radians.
 void setAngleInDegrees(double d)
          Method to set the ray angle in degrees.
 void setHeight(double h)
          Method to set the ray height.
 void setInvalid()
          Method to set the array as invalid (by setting the angle to be Double.NaN.
 void setPlane(double p)
          Method to set the plane of a ray in global coordinates.
 java.lang.String toString()
          Method for format ray as String with package specified format.
 
Methods inherited from class optics.Ray
addMonitor, clearMonitor, getIntensity, getMonitor, getWaveLength, isValid, monitorUpdate, setIntensity, setWaveLength
 
Methods inherited from class optics.Optics
getDefaultWaveLength, getErrorStream, getFormatString, getName, getStaticName, getVersion, printError, setDefaultWaveLength, setErrorStream, setFormatString, setMicrons
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

height

protected double height
Height of the ray


angle

protected double angle
Angle wrt to optical axis in radians


plane

protected double plane
Plane of the rays, being distance along optical axis

Constructor Detail

ParaxialRay

public ParaxialRay()
Default construct for ParaxialRay with height, angle all plane att set to zero.


ParaxialRay

public ParaxialRay(double h,
                   double a)
Constructor for paraxial ray at specified height and angle in plane at position zero.

Parameters:
h - the ray height
a - the ray angle.

ParaxialRay

public ParaxialRay(double h,
                   double a,
                   double p)
Constructor for ParaxialRay at specified height, angle and plane.

Parameters:
h - the ray height
a - the ray angle.
p - the ray plane

ParaxialRay

public ParaxialRay(double h,
                   double p,
                   double h1,
                   double p1)
Constructor to for a ray of height h in plane p towards height h1 in plane p1.

Parameters:
h - height of ray
p - plane ray defined it.
h1 - height of ray is plane 1
p1 - location of plane 1

ParaxialRay

public ParaxialRay(ParaxialRay r)
Constructor for a ParaxialRay with parameters, including wavelength, but not the RayMonitor set by specified ParaxialRay.

Parameters:
r - The ParaxialRay
See Also:
RayMonitor
Method Detail

clone

public ParaxialRay clone()
Method to return a clone (copy) of the current ParaxialRay. All parameters expect the RayMonitor are copied.

Overrides:
clone in class java.lang.Object
Returns:
ParaxialRay clone of current ParaxialRay.

setHeight

public void setHeight(double h)
Method to set the ray height.

Parameters:
h - the ray height.

setAngle

public void setAngle(double a)
Method to set the ray angle in radians.

Parameters:
a - the ray angle in radians.

setAngleInDegrees

public void setAngleInDegrees(double d)
Method to set the ray angle in degrees.

Parameters:
d - the ray angle in degrees.

setPlane

public void setPlane(double p)
Method to set the plane of a ray in global coordinates.

Parameters:
p - position of the plane.

getHeight

public double getHeight()
Method to get the ray height

Returns:
double, the ray height.

getAngle

public double getAngle()
Method to get the ray angle in radians.

Returns:
double the ray angle in radians.

getAngleInDegrees

public double getAngleInDegrees()
Method to get the ray angle in degrees.

Returns:
double the ray angle in degrees.

getPlane

public double getPlane()
Method to get the ray plane in global coordinates.

Returns:
double position of ray plane in global coordinates

setInvalid

public void setInvalid()
Method to set the array as invalid (by setting the angle to be Double.NaN. No further propagation is possible.

Specified by:
setInvalid in class Ray

isInvalid

public boolean isInvalid()
Method to test if a ray has been set invalid.

Specified by:
isInvalid in class Ray
Returns:
boolean true is Ray is invalid.

getPosition

public Position getPosition()
Method get the three dimensional Position of the Ray being (0.0,height,plane). This is normally used for graphical display or in monitoring a RayPath.

Specified by:
getPosition in class Ray
Returns:
Position Three-dimensional position of the Ray.

toString

public java.lang.String toString()
Method for format ray as String with package specified format.

Overrides:
toString in class java.lang.Object
Returns:
String containing formatted information about the ParaxialRay.

crossesZero

public double crossesZero()
Method to calculate where the ray will intersect the optical axis in global coordinates. If parallel it will return NaN.

Returns:
double where ray will cross optical axis.

crosses

public double crosses(ParaxialRay r)
Method to calculate where the given ray will cross the current ray. The position is returned in global coordinates. If the two rays are parallel, it will return NaN.

Parameters:
r - the given ray.
Returns:
double where the two rays cross

heightInPlane

public double heightInPlane(double p)
Method to calculate the height of the ray in the specified plane. Note the Ray is NOT propagated to this plane.

Parameters:
p - position of the plane.
Returns:
double the height in the specified plane

mult

public boolean mult(ParaxialMatrix p)
Method to pre-multiply the current ray by a ParaxialMatrix.

The RayMonitor (if attached) will be called after the multiplication.

Parameters:
p - The matrix.
Returns:
boolean true if successful, false is ray is invalid.

propagate

public boolean propagate(double distance)
Method to propagate a ray a specified distance along the optical axis without using the matrix scheme.

The RayMonitor (if attached) will be called after the propagation.

Parameters:
distance - The distance
Returns:
boolean true is successful, false if ray is invalid or distance is Double.NaN.

propagateTo

public boolean propagateTo(double p)
Method to propagate a ray to a specified plane. without using the matrix scheme.

Any attached RayMonitor will be called after the propagation.

Parameters:
p - the plane in global coordinates.
Returns:
boolean true is successful, false if ray is invalid or distance is Double.NaN.

propagateThrough

public boolean propagateThrough(ParaxialGroup g)
Method to propagate a ray through an ParaxialGroup. The ray is initially propagated to the input plane of the group and then multiplied by the group system matrix.

The height and will tested at both the input and output planes of the ParaxialGroup and the Ray will be set invalid if it exceeds these.

Any attached RayMonitor will be called twice, once after the propagation and then again after the multiplication.

Parameters:
g - the ParaxialGroup
Returns:
boolean true is successful, false if either propagation or height tests fail.

propagateThrough

public int propagateThrough(ParaxialSystem s)
Method to propagate the ray through a ParaxialSystem which consists of a number of ParaxialGroups. The number of groups successfully propagated thought is returned.

Parameters:
s - the ParaxialSystem

pointInPlane

public javax.vecmath.Point2d pointInPlane(double plane)
Method to calculate the point where this ray will intersect a x/y plane specified by it location on the optical z-axis. For Paraxial ray x=0 and y = height.

Note this does NOT propagate the ray to the plane so does not change the rays position.

Specified by:
pointInPlane in class Ray
Parameters:
plane - the z location of the plane
Returns:
Point2d the location in the plane.

edit

public void edit()
Method to invoke the RayEditor. Execution will be suspended until Update/Cancel pressed in Editor.

Any RayMonitor will be called if the ray has been modified by the editor.