|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoptics.Optics
optics.Ray
optics.RayVector
public abstract class RayVector
Abstract class that defines the fundamental ray
geometry and the method to manipulate them.
The practical use of this lass in via the extending classes
currently IntensityRay
.
Will Hossack, The University of Edinburgh
This file is part of Optics.
Optics is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Optics is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Optics. If not, see
Field Summary | |
---|---|
protected double |
currentIndex
Current numerical value of refractive index, Default to Constants.AIR. |
protected Director |
director
The Ray director (or direction cosine) |
protected double |
opticalPathLength
Optical path-length transversed by the ray. |
protected Position |
position
The Ray position in space |
Fields inherited from class optics.Ray |
---|
intensity, monitor, waveLength |
Fields inherited from class optics.Optics |
---|
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS |
Constructor Summary | |
---|---|
RayVector()
|
Method Summary | |
---|---|
void |
addPathLength(double d)
Method add a path |
double |
distance(RayVector ray)
Method to calculate the distance from this Ray to a specified Ray. |
double |
getCurrentIndex()
Method to get the current index value. |
Director |
getDirector()
Method get the director of the RayVector . |
double |
getNormalisedOpticalPathLength()
Method to get the normalsied Optical Path length in units of wavelength. |
double |
getOpticalPathLength()
Method to get optical path length in package units, unusually mm. |
Position |
getPosition()
Method get the position of the RayVector |
boolean |
isInvalid()
Boolean to test if ray is invalid |
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)
Boolean method to propagate the ray a specified distance. |
boolean |
propagate(OpticalSurface s)
Boolean method to propagate a ray to a specified OpticalSurface |
boolean |
propagateThrough(LensSystem ls)
Method to propagate a RayVector through an LensSystem . |
boolean |
propagateThrough(OpticalSurface s)
Method propagate through an OpticalSurface . |
boolean |
reflection(Director u)
Boolean method to reflect the ray from a surface specified by the surface normal. |
boolean |
refraction(Director u,
double refractiveIndex)
Boolean method to refract the ray through a surface specified by the surface normal and refractive index. |
void |
setCurrentIndex(double n)
Method to set the current refractive index value. |
void |
setDirector(Director u)
Method to set the director of the RayVector . |
void |
setInvalid()
Method to set the ray to be invalid by setting director to be invalid. |
void |
setOpticalPathLength(double opl)
Method to set the absolute optical path length in package units (usually mm). |
void |
setPosition(Position p)
Method to set the position of the RayVector . |
java.lang.String |
toString()
String method to get the ray as a formatted String |
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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Position position
protected Director director
protected double opticalPathLength
protected double currentIndex
Constructor Detail |
---|
public RayVector()
Method Detail |
---|
public void setPosition(Position p)
RayVector
.
p
- the positionpublic Position getPosition()
RayVector
getPosition
in class Ray
Position
the position.public void setDirector(Director u)
RayVector
.
u
- the direction.public Director getDirector()
RayVector
.
Director
the current director.public void setCurrentIndex(double n)
Not normally called by users, normally set automatically as ray propagates.
n
- the numerical value of the current index.public double getCurrentIndex()
double
the current index value.public void setOpticalPathLength(double opl)
opl
- the optical path lengthpublic double getOpticalPathLength()
double
the optical path lengthpublic double getNormalisedOpticalPathLength()
If the path length is long this can be a very large number so further calculations may be subject to numerical rounding errors. Use with care.
double
optical path length in wavelengthspublic void addPathLength(double d)
d
- the physical path length.public void setInvalid()
setInvalid
in class Ray
public boolean isInvalid()
isInvalid
in class Ray
boolean
true if invalidpublic boolean propagate(double distance)
RayMonitor
is defined, then this is
automatically updated with the new position.
If ray is set invalid or distance
is
Double.NaN
is then position or
optical path length will not be altered, and no RayMonitor is
updates. If the distance
is Double.NaN
the current ray will also be set invalid, so preventing
further propagation.
distance
- the distance to propagate
boolean
true if success, false if
ray of distance invalid.public boolean propagate(OpticalSurface s)
OpticalSurface.
The distance to the surface is found and then the ray propagated
to it. If the propagation fail the ray will be set to be invalid.
After propagation the ray will be immediately before the
surface.
- Parameters:
s
- the OpticalSurface
- Returns:
boolean
true if successful, false if
unsuccessful, and ray set invalid.- See Also:
propagateThrough(optics.OpticalSurface)
public boolean reflection(Director u)
If u is invalid, ray will be set invalid
u
- the surface normal.
boolean
true for success, false for
failure.public boolean refraction(Director u, double refractiveIndex)
If normal is invalid, ray will be set invalid, but if above critical angle, the ray director will not be altered.
u
- the surface normal.
boolean
true for success, false for
failure.public boolean propagateThrough(OpticalSurface s)
OpticalSurface
.
The Ray will
be propagated to surface first and then refracted or
if mirror, reflected. If the
surface is non-refracting, then its direction will not
be altered but it will be tested for propagation through
the surface apertrure limits.
If either the propagation or the refraction/reflection is unsuccessful, the ray will be set invalid.
s
- the optical surface
boolean
true for success, false for
failure.propagate(optics.OpticalSurface)
,
refraction(optics.Director, double)
,
reflection(optics.Director)
public boolean propagateThrough(LensSystem ls)
LensSystem
.
successfully passed through. If the ray is blocked
or otherwise lost, it will be set to invalid and propagation
halted.
Note if RayMonitor
set it will be updated on each
propagation.
ls
- the LensSystem
boolean
true if propagated through whole systempropagateThrough(optics.OpticalSurface)
public javax.vecmath.Point2d pointInPlane(double plane)
Note this does NOT propagate the ray to the plane so does not change the rays position.
pointInPlane
in class Ray
plane
- the z location of the plane
Point2d
the location in the plane.public double distance(RayVector ray)
ray
- the second Ray
double
the distancepublic java.lang.String toString()
toString
in class java.lang.Object
String
the formatted String
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |