optics.analysis
Class Moments

java.lang.Object
  extended by optics.Optics
      extended by optics.analysis.Moments

public class Moments
extends Optics

Class to implement two-dimensional moments, including methods to perform most calcualtions.


Field Summary
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS, version
 
Constructor Summary
Moments(int order)
          Form a Moments class to a specifed maximum order.
 
Method Summary
 void addPoint(double x, double y, double value)
          Method to add a point with a specific value.
 void addPoint(Point2d pt, double value)
          Method to add a point with a specific value.
 Point2d centroid()
          Method to calcule the centroid of the moment distribution
 double clusterRadius()
          Method to calculate the cluster radius of the moments.
static Moments fromRayPencil(RayPencil pencil, double plane, int order)
          Static method to form the moments from where the rays in a RayPencil intersects a specified plane.
static Moments fromRayPencil(RayPencil pencil, OpticalPlane plane, int order)
          Satic method to for the moment of a of the rays in a RayPencil as they intersect a specified OpticalPlane.
 double getMoment(int m, int n)
          Method to get a moment value
 int getOrder()
          Method to get the order
 
Methods inherited from class optics.Optics
getDefaultWaveLength, getErrorStream, getFormatString, getName, getStaticName, getVersion, printError, setDefaultWaveLength, setErrorStream, setFormatString, setMicrons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Moments

public Moments(int order)
Form a Moments class to a specifed maximum order.

Parameters:
order - the maximum order
Method Detail

getOrder

public int getOrder()
Method to get the order

Returns:
int the maximum order.

addPoint

public void addPoint(double x,
                     double y,
                     double value)
Method to add a point with a specific value.

Parameters:
x - the x location.
y - the y location.
value - the value of the point.

addPoint

public void addPoint(Point2d pt,
                     double value)
Method to add a point with a specific value.

Parameters:
pt - the point.
value - the value of of the point.

getMoment

public double getMoment(int m,
                        int n)
Method to get a moment value

Parameters:
m - The m value
n - The n value
Returns:
double The moment value

centroid

public Point2d centroid()
Method to calcule the centroid of the moment distribution

Returns:
Point2d Location of centroid.

clusterRadius

public double clusterRadius()
Method to calculate the cluster radius of the moments.

Returns:
double the cluster radius

fromRayPencil

public static Moments fromRayPencil(RayPencil pencil,
                                    OpticalPlane plane,
                                    int order)
Satic method to for the moment of a of the rays in a RayPencil as they intersect a specified OpticalPlane. The ray pencil is NOT propagated to the plane.

Parameters:
pencil - the RayPencil containing the rays
plane - the OpticalPlane
order - the morder of the expansion.

fromRayPencil

public static Moments fromRayPencil(RayPencil pencil,
                                    double plane,
                                    int order)
Static method to form the moments from where the rays in a RayPencil intersects a specified plane.

Parameters:
pencil - the Raypencil holding the rays.
plane - the z location of the plane.
order - the order the moments are calculate to
Returns:
Moments the Moments