experiment.property
Class Position

java.lang.Object
  extended by experiment.property.Position

public class Position
extends java.lang.Object

Created by IntelliJ IDEA. User: andy Date: Mar 9, 2010 A position in the 3 dimensional plane


Constructor Summary
Position(float x, float y, float z, double phi, double theta)
          Default constructor
 
Method Summary
 double getPhi()
          Returns the phi angle of the relative coordinate system
 double getTheta()
          Returns the theta angle of the relative coordinate system
 javax.vecmath.Vector3d getVector3d()
          Converts an experiment entity position to a 3d canvas position.
 float getX()
          Returns the objects x axis value
 float getY()
          Returns the objects y axis value
 float getZ()
          Returns the objects z axis value
 boolean near(double a, double b)
          Loosly compares two values.
 boolean same(javax.vecmath.Vector3d position)
          Compares this position to a transform position.
 void setPhi(double phi)
          Sets the phi angle
 void setTheta(double theta)
          Sets the theta angle
 void setX(float x)
          Sets the x axis coordinate value
 void setY(float y)
          Sets the y axis coordinate value
 void setZ(float z)
          Sets the z axis coordinate value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Position

public Position(float x,
                float y,
                float z,
                double phi,
                double theta)
Default constructor

Parameters:
x - is given in degrees
y - is given in degrees
z - is given in radians
phi - angle in degrees.
theta - angle in degrees.
Method Detail

getPhi

public double getPhi()
Returns the phi angle of the relative coordinate system

Returns:
the phi angle

getTheta

public double getTheta()
Returns the theta angle of the relative coordinate system

Returns:
the theta angle

getVector3d

public javax.vecmath.Vector3d getVector3d()
Converts an experiment entity position to a 3d canvas position. In order to abide to java3d's orientation of the axis, y and z values need to be swapped.

Returns:
a vactor of three doubles, containing the rearranged axis values.

getX

public float getX()
Returns the objects x axis value

Returns:
x value in meters

getY

public float getY()
Returns the objects y axis value

Returns:
y value in meters

getZ

public float getZ()
Returns the objects z axis value

Returns:
z value in degrees

near

public boolean near(double a,
                    double b)
Loosly compares two values.

Parameters:
a - the first value.
b - the second value.
Returns:
true if the values are very close or the same.

same

public boolean same(javax.vecmath.Vector3d position)
Compares this position to a transform position. It is used to facilitate indexing of a Node3d when a user picks it.

Parameters:
position - a three dimensional Vector containing the x, y, z double values.
Returns:
true is same.

setPhi

public void setPhi(double phi)
Sets the phi angle

Parameters:
phi - tha angle in radians

setTheta

public void setTheta(double theta)
Sets the theta angle

Parameters:
theta -

setX

public void setX(float x)
Sets the x axis coordinate value

Parameters:
x - value in meters

setY

public void setY(float y)
Sets the y axis coordinate value

Parameters:
y - value in meters

setZ

public void setZ(float z)
Sets the z axis coordinate value

Parameters:
z - value in degrees