Class TSPos

java.lang.Object
  extended by TSPos
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TSQPos

 class TSPos
extends java.lang.Object
implements java.io.Serializable

.

======================================================================
 Klasse TSPos -- Definition eines Positionsvektors
 Die Klasse beschreibt einen Positionsvector relativ zu (0,0,0)
 ##TSPos (Eyecatcher)
======================================================================
 


Field Summary
protected static java.lang.String IdStr
           
private  double Px
           
private  double Py
           
private  double Pz
           
 
Constructor Summary
protected TSPos()
          .
protected TSPos(double px, double py, double pz)
          .
protected TSPos(TSPos cP)
          .
 
Method Summary
protected  int addPosX(double d)
          .
protected  int addPosY(double d)
          .
protected  int addPosZ(double d)
          .
protected  int clipPos()
          .
protected  double cmpAbs(TSPos cP, int dx, int dz)
          .
protected  java.lang.String getPos(boolean comma)
          .
protected  java.lang.String getPos(int prec, int opt)
          .
protected  double getPosX()
          .
protected  double getPosY()
          .
protected  double getPosZ()
          .
protected  void modPos(boolean m, TSPos cP)
          .
protected  java.lang.String mul(TSQDir q)
          .
protected  java.lang.String shftPos(TSPos cP)
          .
protected  java.lang.String toEnd(TSQDir q, double rl, double w)
          .
protected  java.lang.String toStr()
          .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IdStr

protected static final java.lang.String IdStr
See Also:
Constant Field Values

Px

private double Px

Py

private double Py

Pz

private double Pz
Constructor Detail

TSPos

protected TSPos()
.
=====================================================================
 Constructor: (1) Create default-entry
=====================================================================
  


TSPos

protected TSPos(double px,
                double py,
                double pz)
.
=====================================================================
 Constructor: (2) Create standard-entry
=====================================================================
  


TSPos

protected TSPos(TSPos cP)
.
=====================================================================
 Constructor: (3) Create copy-entry from template
=====================================================================
  

Method Detail

addPosX

protected final int addPosX(double d)
.
=====================================================================
 Methode "addPosX"
 Positionswert X korrigieren und Quadrantenfehler ermitteln
   (Objekt verschieben)
 ##addPosX.TSPos (Eyecatcher)
=====================================================================
  


addPosY

protected final int addPosY(double d)
.
=====================================================================
 Methode "addPosY"
 Positionswert Y (Hoehe) korrigieren (Objekt verschieben)
 ##addPosY.TSPos (Eyecatcher)
=====================================================================
  


addPosZ

protected final int addPosZ(double d)
.
=====================================================================
 Methode "addPosZ"
 Positionswert Z korrigieren und Quadrantenfehler ermitteln
   (Objekt verschieben)
 ##addPosZ.TSPos (Eyecatcher)
=====================================================================
  


clipPos

protected final int clipPos()
.
=====================================================================
 Methode "clipPos"
 Positionswerte auf gueltige Werte (-1024..+1024) aendern
 Y-Komponete (Hoehe) wird nicht veraendert
 ##clipPos.TSPos (Eyecatcher)
=====================================================================
  


cmpAbs

protected final double cmpAbs(TSPos cP,
                              int dx,
                              int dz)
.
=====================================================================
 Methode "cmpAbs"
 Compute distance between two position-values.
 This method returns the distance of two koordinates, which is
   computed due to Pythargoras.
 ##cmpAbs.TSPos (Eyecatcher)
=====================================================================
  


getPos

protected final java.lang.String getPos(int prec,
                                        int opt)
.
=====================================================================
 Methode "getPos"
 Information-Hiding: Positionswerte in Zeichenkettenform liefern
 Aufbereitungsoptionen nach dem Primzahlverfahren:
  2 - Px-Wert NICHT beruecksichtigen
  3 - Py-Wert NICHT beruecksichtigen (Hoehenwert)
  5 - Pz-Wert NICHT beruecksichtigen
 Achtung: Ergebnis enthaelt ein fuehrendes Leerzeichen
 ##getPos.TSPos (Eyecatcher)
=====================================================================
  


getPos

protected final java.lang.String getPos(boolean comma)
.
=====================================================================
 Methode "getPos" (2.Version)
 Information-Hiding: Positionswerte in Zeichenkettenform liefern
 Aufbereitung erfolgt ohne Rundungsmoeglichkeit
 ##getPos.TSPos (Eyecatcher)
=====================================================================
  


getPosX

protected final double getPosX()
.
=====================================================================
 Methode "getPosX"
 Get X-value of a position-definition (information-Hiding)
  This method is used to successfully create a 'TSCoo'-object
 ##getPosX.TSPos (Eyecatcher)
=====================================================================
  


getPosY

protected final double getPosY()
.
=====================================================================
 Methode "getPosY"
 Information-Hiding: Positionswert Y (Hoehe) liefern
 ##getPosY.TSPos (Eyecatcher)
=====================================================================
  


getPosZ

protected final double getPosZ()
.
=====================================================================
 Methode "getPosZ"
 Get Z-value of a position-definition (information-Hiding)
  This method is used to successfully create a 'TSCoo'-object
 ##getPosZ.TSPos (Eyecatcher)
=====================================================================
  


modPos

protected void modPos(boolean m,
                      TSPos cP)
.
=====================================================================
 Methode "modPos"
 'add' or 'sub' difference-vector to/from current position
 This realizes a 'shift-operation'
 ##modPos.TSPos (Eyecatcher)
=====================================================================
  


mul

protected final java.lang.String mul(TSQDir q)
.
=====================================================================
 Methode "mul"
 Positionswerte mit Quaterion multiplizieren und ggf. Fehler melden
 --> Vector (=aktuelles Positionsobjekt) gemaess Quaterion rotieren
 Also compare to 'Object-Rotator'-manual (Rotating a 3D-vector)
 Px' = (Qx*Qx - Qy*Qy - Qz*Qz + Qw*Qw)*Px +
       2*(Qx*Qy + Qz*Qw)*Py + 2*(Qx*Qz - Qy*Qw)*Pz
 Py' = 2*(Qx*Qy - Qz*Qw)*Px + (Qy*Qy - Qx*Qx - Qz*Qz + Qw*Qw)*Py +
       2*(Qx*Qw - Qy*Qz)*Pz
 Pz' = 2*(Qx*Qz + Qy*Qw)*Px + 2*(Qy*Qz - Qx*Qw)*Py +
         (Qz*Qz - Qx*Qx - Qy*Qy + Qw*Qw)*Pz
 ##mul.TSPos (Eyecatcher)
=====================================================================
  


shftPos

protected final java.lang.String shftPos(TSPos cP)
.
=====================================================================
 Methode "shftPos"
 Shift Position of object 'half way' in direction of second object
 ##shftPos.TSPos (Eyecatcher)
=====================================================================
  


toEnd

protected final java.lang.String toEnd(TSQDir q,
                                       double rl,
                                       double w)
.
=====================================================================
 Method "toEnd"
 Current vector points to beginning of section -- compute End-Position
 'rl' may be negative if position has to be subtracted (left curve)
 Also compare to 'Object-Rotator'-manual (Rotating a 3D-vector)
 specially: rotating vector (0,0,1) -> (x3,y3,z3)
 w==0.0 (rl is 'length'):
    Px = Px + rl * 2*(Qx*Qz - Qy*Qw)
    Py = Py + rl * 2*(Qx*Qw + Qy*Qz)
    Pz = Pz + rl * (Qz*Qz + Qw*Qw - Qx*Qx - Qy*Qy)
 w!=0.0 (rl is 'radius'):
    Px = Px + rl*sin(w) * 2*(Qx*Qz - Qy*Qw)
         - rl*(1-cos(w)) * (Qx*Qx - Qy*Qy - Qz*Qz + Qw*Qw)
    Py = Py + rl*sin(w) * 2*(Qx*Qw + Qy*Qz)
         - rl*(1-cos(w)) * 2*(Qx*Qy - Qz*Qw)
    Pz = Pz + rl*sin(w) * (Qz*Qz + Qw*Qw - Qx*Qx - Qy*Qy)
         - rl*(1-cos(w)) * 2*(Qx*Qz + Qy*Qw)
 ##toEnd.TSPos (Eyecatcher)
=====================================================================
  


toStr

protected java.lang.String toStr()
.
=====================================================================
 Method "toStr"
 Build a string-representation of all values of this class
 ##toStr.TSPos (Eyecatcher)
=====================================================================