nl.kun.Engine3D
Class TCoordSys3D

java.lang.Object
  |
  +--nl.kun.Engine3D.TVector3D
        |
        +--nl.kun.Engine3D.TCoordSys3D
Direct Known Subclasses:
TEntity3D

public class TCoordSys3D
extends TVector3D

This class defines a coordinate system. It uses the x, y and z value of it's parent TVector3D as it's origin has TVector3D's for it's x-axis, y-axis and Z-axis. It also contains a lot of functions that can manipulate coordinate systems.


Field Summary
 TVector3D Xaxis
          The x-axis of the coordinate system
 TVector3D Yaxis
          The y-axis of the coordinate system
 TVector3D Zaxis
          The z-axis of the coordinate system
 
Fields inherited from class nl.kun.Engine3D.TVector3D
DBSCIENTIFIC, DBSTANDARD, x, y, z
 
Constructor Summary
TCoordSys3D()
          Empty constructor.
TCoordSys3D(double _x, double _y, double _z, double _xax, double _xay, double _xaz, double _yax, double _yay, double _yaz, double _zax, double _zay, double _zaz)
          Constructor.
TCoordSys3D(double _x, double _y, double _z, TVector3D _Xaxis, TVector3D _Yaxis, TVector3D _Zaxis)
          Constructor
TCoordSys3D(TCoordSys3D _CoordSys3D)
          Copy Constructor.
TCoordSys3D(TVector3D _posVec, TVector3D _Xaxis, TVector3D _Yaxis, TVector3D _Zaxis)
          Constructor
 
Method Summary
 TCoordSys3D CoordSys3D(double _x, double _y, double _z, double _xax, double _xay, double _xaz, double _yax, double _yay, double _yaz, double _zax, double _zay, double _zaz)
          Like the standard constructor of this coordinate system only the object already exists.
 TCoordSys3D CoordSys3D(TCoordSys3D _CoordSys3D)
          Like a copy constructor, only the object already exists but it's member variables are overwritten
 TCoordSys3D CoordSys3D(TVector3D _posVec, TVector3D _Xaxis, TVector3D _Yaxis, TVector3D _Zaxis)
          Like a constructor, only the object already exists.
 TVector3D Global2Local(double _x, double _y, double _z)
          Converts a vector from a local coordinate system to this coordinate system.
 TVector3D Global2Local(TVector3D _Global)
          Converts a vector from a local coordinate system to this coordinate system.
 TVector3D Global2Local(TVector3D _Global, TVector3D _Local)
          Converts a vector from a local coordinate system to this coordinate system.
 TVector3D Local2Global(double _x, double _y, double _z)
          Converts a vector from it's local coordinate system to a global coordinate system.
 TVector3D Local2Global(TVector3D _Local)
          Converts a vector from it's local coordinate system to a global coordinate system.
 TVector3D Local2Global(TVector3D _Local, TVector3D _Global)
          Converts a vector from it's local coordinate system to a global coordinate system.
 void Rotate(TVector3D _PosVec, TVector3D _DirVec, double _Angle)
          Rotates this coordinate system with respect to the line defined by a direction vector and a position vector, by an amount _Angle measured in radians.
 java.lang.String toString()
          Used when a string version of this object is needed
 TVector3D Translate(double _dx, double _dy, double _dz)
          Translates this coordinate system by a certain displacement
 TVector3D Translate(TVector3D _dr)
          Translates this coordinate system by a certain displacement
 
Methods inherited from class nl.kun.Engine3D.TVector3D
Angle, Double2String, Double2String, Modulus, Modulus, Negate, Negate, Normalize, Normalize, NulVec, StdXaxis, StdYaxis, StdZaxis, String2Double, VAdd, VCrossProduct, VCrossProduct, VDotProduct, Vector3D, Vector3D, Vector3D, VPerpendicular, VPerpendicular, VScalarProduct, VScalarProduct, VScalarProduct, VSubstract, VSubstract
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Xaxis

public TVector3D Xaxis
The x-axis of the coordinate system

Yaxis

public TVector3D Yaxis
The y-axis of the coordinate system

Zaxis

public TVector3D Zaxis
The z-axis of the coordinate system
Constructor Detail

TCoordSys3D

public TCoordSys3D(double _x,
                   double _y,
                   double _z,
                   double _xax,
                   double _xay,
                   double _xaz,
                   double _yax,
                   double _yay,
                   double _yaz,
                   double _zax,
                   double _zay,
                   double _zaz)
Constructor.
Parameters:
_x - the x-value of the origin vector
_y - the y-value of the origin vector
_z - the z-value of the origin vector
_xax - the x-value of the x-axis vector
_xay - the y-value of the x-axis vector
_xaz - the z-value of the x-axis vector
_yax - the x-value of the y-axis vector
_yay - the y-value of the y-axis vector
_yaz - the z-value of the y-axis vector
_zax - the x-value of the z-axis vector
_zay - the y-value of the z-axis vector
_zaz - the z-value of the z-axis vector

TCoordSys3D

public TCoordSys3D(TVector3D _posVec,
                   TVector3D _Xaxis,
                   TVector3D _Yaxis,
                   TVector3D _Zaxis)
Constructor
Parameters:
_posVec - The origin vector
_Xaxis - The x-axis vector
_Yaxis - The y-axis vector
_Zaxis - The z-axis vector

TCoordSys3D

public TCoordSys3D(double _x,
                   double _y,
                   double _z,
                   TVector3D _Xaxis,
                   TVector3D _Yaxis,
                   TVector3D _Zaxis)
Constructor
Parameters:
_x - the x-value of the origin vector
_y - the y-value of the origin vector
_z - the z-value of the origin vector
_Xaxis - The x-axis vector
_Yaxis - The y-axis vector
_Zaxis - The z-axis vector

TCoordSys3D

public TCoordSys3D()
Empty constructor. Creates a coordinate system ( (0,0,0); (1,0,0); (0,1,0); (0,0,1) )

TCoordSys3D

public TCoordSys3D(TCoordSys3D _CoordSys3D)
Copy Constructor.
Parameters:
_CoordSys3D - Object to be copied to this object.
Method Detail

CoordSys3D

public TCoordSys3D CoordSys3D(TCoordSys3D _CoordSys3D)
Like a copy constructor, only the object already exists but it's member variables are overwritten
Parameters:
_CoordSys3D - The object that is to be copied into this object

CoordSys3D

public TCoordSys3D CoordSys3D(TVector3D _posVec,
                              TVector3D _Xaxis,
                              TVector3D _Yaxis,
                              TVector3D _Zaxis)
Like a constructor, only the object already exists. It's member variables are overwritten by the input.
Parameters:
_x - the x-value of the origin vector
_y - the y-value of the origin vector
_z - the z-value of the origin vector
_Xaxis - The x-axis vector
_Yaxis - The y-axis vector
_Zaxis - The z-axis vector

CoordSys3D

public TCoordSys3D CoordSys3D(double _x,
                              double _y,
                              double _z,
                              double _xax,
                              double _xay,
                              double _xaz,
                              double _yax,
                              double _yay,
                              double _yaz,
                              double _zax,
                              double _zay,
                              double _zaz)
Like the standard constructor of this coordinate system only the object already exists. It's member variables are overwritten by the input.
Parameters:
_x - the x-value of the origin vector
_y - the y-value of the origin vector
_z - the z-value of the origin vector
_xax - the x-value of the x-axis vector
_xay - the y-value of the x-axis vector
_xaz - the z-value of the x-axis vector
_yax - the x-value of the y-axis vector
_yay - the y-value of the y-axis vector
_yaz - the z-value of the y-axis vector
_zax - the x-value of the z-axis vector
_zay - the y-value of the z-axis vector
_zaz - the z-value of the z-axis vector

Local2Global

public TVector3D Local2Global(TVector3D _Local)
Converts a vector from it's local coordinate system to a global coordinate system. It should be invoked on a coordinate system that is the global equivalent from the local coordinate system.
Parameters:
_Local - The vector that should be converted

Local2Global

public TVector3D Local2Global(TVector3D _Local,
                              TVector3D _Global)
Converts a vector from it's local coordinate system to a global coordinate system. It should be invoked on a coordinate system that is the global equivalent from the local coordinate system.
Parameters:
_Local - The vector that should be converted\
_Global - The result.

Local2Global

public TVector3D Local2Global(double _x,
                              double _y,
                              double _z)
Converts a vector from it's local coordinate system to a global coordinate system. It should be invoked on a coordinate system that is the global equivalent from the local coordinate system.
Parameters:
_xg - The x component of the vector to be globalised.
_yg - The y component of the vector to be globalised.
_zg - The z component of the vector to be globalised.

Global2Local

public TVector3D Global2Local(TVector3D _Global)
Converts a vector from a local coordinate system to this coordinate system.
Parameters:
_Global - The vector that should be converted

Global2Local

public TVector3D Global2Local(double _x,
                              double _y,
                              double _z)
Converts a vector from a local coordinate system to this coordinate system.
Parameters:
_xl - x component of the vector to be converted.
_yl - y component of the vector to be converted.
_zl - z component of the vector to be converted.

Global2Local

public TVector3D Global2Local(TVector3D _Global,
                              TVector3D _Local)
Converts a vector from a local coordinate system to this coordinate system.
Parameters:
_Global - the vector to be converted.
_Local - the result

Rotate

public void Rotate(TVector3D _PosVec,
                   TVector3D _DirVec,
                   double _Angle)
Rotates this coordinate system with respect to the line defined by a direction vector and a position vector, by an amount _Angle measured in radians.
Overrides:
Rotate in class TVector3D
Parameters:
_PosVec - The position vector of the rotation line
_DirVec - The direction vector of the rotation line
_Angle - The angle over which to rotate (in radians)

Translate

public TVector3D Translate(double _dx,
                           double _dy,
                           double _dz)
Translates this coordinate system by a certain displacement
Overrides:
Translate in class TVector3D
Parameters:
_dx - Displacement in x direction
_dy - Displacement in y direction
_dz - Displacement in z direction

Translate

public TVector3D Translate(TVector3D _dr)
Translates this coordinate system by a certain displacement
Overrides:
Translate in class TVector3D
Parameters:
_dr - Displacement vector.

toString

public java.lang.String toString()
Used when a string version of this object is needed
Overrides:
toString in class TVector3D