|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.vecmath.Tuple3d
javax.vecmath.Point3d
optics.Position
public class Position
Class to implement a three-dimensional position held as three doubles with some support methods to help in ray propagation.
This class extends the Point3d
from the javax.vecmath
package with is part of
Java3D
Field Summary |
---|
Fields inherited from class javax.vecmath.Tuple3d |
---|
x, y, z |
Constructor Summary | |
---|---|
Position()
Default constructor all three coordinates defaulting to zero. |
|
Position(double z)
Constructor with one double, being z, with x and y defaulting to zero. |
|
Position(double x,
double y)
Constructor with two doubles, being x and y with z defaulting to zero. |
|
Position(double x,
double y,
double z)
Constructor with three doubles. |
|
Position(javax.vecmath.Tuple2d t)
Constructor with position specified any double Truple2d with z defaulting to zero. |
|
Position(javax.vecmath.Tuple2d t,
double z)
Constructor with position specified any double Truple2d and a specified z. |
|
Position(javax.vecmath.Tuple3d t)
Constructor with position specified any double Truple3d |
Method Summary | |
---|---|
void |
add(double dx,
double dy,
double dz)
Method to add to the current position |
Position |
clone()
Clone method to clone the Position. |
Director |
direction(javax.vecmath.Tuple3d p)
Method to get the Director from the current
Position to the specified Position |
static Position |
fromString(java.lang.String s)
Static method to parse a Position from a String which contains three doubles separated by spaces, commas or () in any order. |
static Position |
fromTokens(java.util.StringTokenizer tokens)
Static method to parse a Position from StringTokenizer tokens. |
javax.vecmath.Point2d |
getPoint2d()
Method to get the x/y locations as a Point2d |
double |
length()
Calculate the length from origin. |
double |
length(javax.vecmath.Tuple3d p)
Calcuate the length from specified Truple3d |
double |
lengthSquared()
Calculate the length squared from origin. |
double |
lengthSquared(javax.vecmath.Tuple3d p)
Calcuate the length square from a specified Tuple3d |
void |
max(javax.vecmath.Tuple3d p)
Method to take the maximum of the current point and a specified point treatimg all three coordinates separetely. |
void |
min(javax.vecmath.Tuple3d p)
Method to take the minimum of the current point and a specified point treating all three coordinates separetely. |
void |
propagate(javax.vecmath.Tuple3d u,
double d)
Method to propagated the current point a distance d in the direction u . |
Methods inherited from class javax.vecmath.Point3d |
---|
distance, distanceL1, distanceLinf, distanceSquared, project |
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 Position(double x, double y, double z)
x
- the X valuey
- the Y valuez
- the Z valuepublic Position(double x, double y)
x
- the X valuey
- the Y valuepublic Position(double z)
z
- the Z locationpublic Position()
public Position(javax.vecmath.Tuple3d t)
t
- the Truple3dpublic Position(javax.vecmath.Tuple2d t, double z)
Truple2d
and a specified z.
t
- specified the x and yz
- public Position(javax.vecmath.Tuple2d t)
Truple2d
with z defaulting to zero.
t
- specified the x and yMethod Detail |
---|
public Position clone()
clone
in class javax.vecmath.Tuple3d
Position
clone of Positionpublic double lengthSquared()
double
length squaredpublic double length()
double
the length.public double lengthSquared(javax.vecmath.Tuple3d p)
Tuple3d
p
- the specified Truple3d
double
length squared to specified pointpublic double length(javax.vecmath.Tuple3d p)
p
- the specified Truple3d
double
length to specified pointpublic javax.vecmath.Point2d getPoint2d()
Point2d
the x/y location as
a Point2d.public void add(double dx, double dy, double dz)
dx
- the x valuedy
- the y valuedz
- the z valuepublic void propagate(javax.vecmath.Tuple3d u, double d)
d
in the direction u
.
Note this method does not check for invalid operations.
u
- the directiond
- the distancepublic void min(javax.vecmath.Tuple3d p)
p
- the specified pointpublic void max(javax.vecmath.Tuple3d p)
p
- the specified pointpublic Director direction(javax.vecmath.Tuple3d p)
Director
from the current
Position to the specified Position
p
- the second Positionpublic static Position fromString(java.lang.String s)
StringTokenizer
to the parsing.
- Parameters:
s
- the String containing the position.
- Returns:
Position
the parsed Position,
null
if anything fails.
public static Position fromTokens(java.util.StringTokenizer tokens)
StringTokenizer
tokens. It
assumes there are three tokens with the x,y,z
which can be read.
tokens
- the tokens
Position
the parsed Position,
null
if anything fails.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |