|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.vecmath.Tuple3d
javax.vecmath.Vector3d
optics.Director
public class Director
Class to implement a three-dimensional director being the direction cosines. It is used to hold a ray direction or a surface normal. This class also implements reflection and refraction at interfaces.
Field Summary |
---|
Fields inherited from class javax.vecmath.Tuple3d |
---|
x, y, z |
Constructor Summary | |
---|---|
Director()
Default Director will be set to invalid by default with all three compoents set to Double.NaN . |
|
Director(Angles a)
Constructor for a Director specifying two direction angles specifed by a Angles object |
|
Director(Director u)
Construct a director specified by a Director
which is assumes to be normalised, so the component
values are just copied. |
|
Director(double theta)
Constructor a director by specifying one director angles, being the angle with respect to the z-axis. |
|
Director(double theta,
double psi)
Constructor for a Director specifying two direction angles. |
|
Director(double x,
double y,
double z)
Constructor a director with three doubles. |
|
Director(javax.vecmath.Tuple3d t)
Constructor a director from any Tuple3d . |
|
Director(javax.vecmath.Tuple3d start,
javax.vecmath.Tuple3d end)
Constructor to form the Director from a specified start Position towards a specified end
Position . |
Method Summary | |
---|---|
Director |
clone()
Return the clone of the current Director |
Angles |
getAngles()
Method to get the Director angles |
boolean |
isInvalid()
Boolean to test if Director is invalid. |
boolean |
isValid()
Boolean to test if Director is valid. |
boolean |
reflection(Director u)
Method to reflect from a surface specified by its surface normal. |
boolean |
refraction(Director u,
double ratio)
Method to refract at a surface specified by it surface normal. |
void |
set(Angles a)
Method to se tthe director with theta/psi angles specifed in a Angles object |
void |
set(double theta,
double psi)
Method to se tthe director with theta/psi angles |
void |
setInvalid()
Set the current director to invalid, all three componets with be set to Double.NaN |
Methods inherited from class javax.vecmath.Vector3d |
---|
angle, cross, dot, length, lengthSquared, normalize, normalize |
Methods inherited from class javax.vecmath.Tuple3d |
---|
absolute, absolute, add, add, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, epsilonEquals, equals, equals, get, get, getX, getY, getZ, hashCode, interpolate, interpolate, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, scaleAdd, set, set, set, set, setX, setY, setZ, sub, sub, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Director(double x, double y, double z)
x
- the x valuey
- the y valuez
- the z valuepublic Director(javax.vecmath.Tuple3d t)
Tuple3d
. It will be
automatically normalised so its length is unity.
t
- the Tuplepublic Director(Director u)
Director
which is assumes to be normalised, so the component
values are just copied.
u
- the Directorpublic Director(Angles a)
Angles
object
a
- the Anglespublic Director(double theta, double psi)
theta
- angle with respect to to z-axispsi
- angle with respect to y-axis.public Director(double theta)
theta
- angle with respect to the z-axispublic Director()
Double.NaN
.
public Director(javax.vecmath.Tuple3d start, javax.vecmath.Tuple3d end)
Position
towards a specified end
Position
. Again the element values are
normalised.
start
- the start Positionend
- the end PositionMethod Detail |
---|
public Director clone()
clone
in class javax.vecmath.Tuple3d
Director the clone.
public void set(double theta, double psi)
theta
- the theta anglepsi
- the psi anglepublic void set(Angles a)
a
- the Anglespublic void setInvalid()
Double.NaN
isValid()
,
isInvalid()
public boolean isValid()
Double.NaN
.
boolean
true if validpublic boolean isInvalid()
Double.NaN
.
boolean
true if invalidpublic Angles getAngles()
Angles
the director anglespublic boolean reflection(Director u)
true
if successful and
false
if either
current director or surface normal is set to invalid.
If fails current director will be set invalid.
u
- the surface normal.
boolean
true for success, false for failure.public boolean refraction(Director u, double ratio)
If failure is due to surface normal or ratio being invalid, current director is set invalid however if failure is due to being above critical angle, director is not changed.
u
- the surface normalratio
- refractive index ration
boolean
true for success, false for failure.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |