|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoptics.Angles
public class Angles
Class to implement the Angle pair theta,psi where theta is the angle from the z-axis and psi from the y-axis.
Field Summary | |
---|---|
double |
psi
The psi angle |
double |
theta
The theta angle |
Constructor Summary | |
---|---|
Angles()
Form a Angles object with both angles
defaulting to zero |
|
Angles(Angles a)
Form a Angles object with angle taken from the
specifying Angles object |
|
Angles(Director u)
Form a Angles object specifing a
Director |
|
Angles(double theta)
Form an Angles object specifing of the theta
angle, the psi defaulting to zero. |
|
Angles(double theta,
double psi)
Form a Angles object specifing
both angle in radians. |
Method Summary | |
---|---|
Angles |
clone()
Method to clone the current Angles object. |
static Angles |
fromString(String s)
Static method to parse a Angles from a String which contains two doubles separated by spaces, commas or () in any order. |
static Angles |
fromTokens(StringTokenizer tokens)
Static method to parse a Position from StringTokenizer tokens. |
Director |
getDirector()
Method to get the positive z -directions
Director from the angles. |
double |
getPsi()
Method to get the psi angle wrt to z-axis |
double |
getPsiDegrees()
Method to get the psi angle wrt to z-axis in degress |
double |
getTheta()
Method to get the theta angle wrt to z-axis |
double |
getThetaDegrees()
Method to get the theta angle wrt to z-axis in degrees |
static void |
main(String[] args)
Static test main methods to read in Angles, and test conversion to Director and back again. |
void |
set(Director u)
Method to set the Angles from a Director |
void |
set(double th,
double ps)
Method to set the two angles in radians |
void |
setDegrees(double th,
double ps)
Method to set the two angles in degrees |
void |
setPsi(double psi)
Method to set psi in radians |
void |
setPsiDegrees(double psi)
Method to set psi in degrees |
void |
setTheta(double th)
Method to set theta in radians |
void |
setThetaDegrees(double th)
Method to set theta in degrees |
String |
toString()
Method to get as information as formatted String. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double theta
public double psi
Constructor Detail |
---|
public Angles(double theta, double psi)
Angles
object specifing
both angle in radians.
theta
- the theta anglepsi
- the psi anglepublic Angles(Director u)
Angles
object specifing a
Director
u
- the Directorpublic Angles(double theta)
Angles
object specifing of the theta
angle, the psi defaulting to zero.
theta
- the theta anglepublic Angles()
Angles
object with both angles
defaulting to zero
public Angles(Angles a)
Angles
object with angle taken from the
specifying Angles object
Method Detail |
---|
public Angles clone()
clone
in class Object
Angles
clone of current Angles objectpublic void set(double th, double ps)
th
- the theta angleps
- the psi anglepublic void setDegrees(double th, double ps)
th
- the theta angleps
- the psi anglepublic void set(Director u)
u
- the Directorpublic void setTheta(double th)
th
- the theta anglepublic void setThetaDegrees(double th)
th
- the theta anglepublic double getTheta()
double
the theta anglepublic double getThetaDegrees()
double
the theta angle in degreespublic void setPsi(double psi)
psi
- the psi anglepublic void setPsiDegrees(double psi)
psi
- the psi angle in degresspublic double getPsi()
double
the psi anglepublic double getPsiDegrees()
double
the psi angle in degreespublic Director getDirector()
z
-directions
Director from the angles.
Director
the director (or direction
cosine triplet.public String toString()
toString
in class Object
String
formatted String.public static Angles fromString(String s)
StringTokenizer
to the parsing.
- Parameters:
s
- the String containing the angles
- Returns:
Position
the parsed Angles
null
if anything fails.
public static Angles fromTokens(StringTokenizer tokens)
StringTokenizer
tokens. It
assumes there are at least two tokens being theta,psi
in degress which can be read.
If there are more than two token, then the next
three are read using nextToken()
.
tokens
- the tokens
Angles
the parsed Angles,
null
if anything fails.public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |