class Tensor


Syntax
Tensor class allows users to treat tensors as  variables and operate on them.

Description
Tensor class is composed with 2 dimensional (3X3)  arrays whose elements correspond to each component of tensor, and methods which are for tensor operation.


MEMBER SUMMARY

Tensor()                    constructor
String Show()            return string composed with the tensor's elment value
double Get_Elem()    get elmental value
Tensor Plus()            openration corresponding to arithmatic "+"
Tensor Minus()            openration corresponding to arithmatic "-"
Tensor Mult()            openration corresponding to arithmatic "*"
void X_Rotate()        rotation around X axis
void Y_Rotate()        rotation around Y axis
void Z_Rotate()        rotation around Z axis
 


Tensor


PURPOSE :
Constructor in some styles

SYNTAX :
         Tensor( double InitX00,double InitX01,double InitX02,
                      double InitX10,double InitX11,double InitX12,
                      double InitX20,double InitX21,double InitX22)
         Tensor(Tensor Other_Tensor)
         Tensor(double X00)
         Tensor()
DESCRIPTION :
9 components can be substituted into tensor, which is most basic method to fix a tensor.
The clone is generated by another tensor, which may be calculated from the  methods of this class.
Double number X00 of suffix gives i-i componets the number.
No suffix is for X00=1.0.
 

PARAMETERS :
         InitX00 , InitX01 , InitX02,  InitX10, InitX11, InitX12,  InitX20, InitX21, InitX22
                        Substituted into i-j componets
         Other_Tensor        Making clone of other tensor into this instance
         X00                        i-i componets are X00

RETURNS : none

SEEALSO : Vector class

EXAMPLE :


Get_Elem



PURPOSE : Get i-j component of a tensor.

SYNTAX : double Get_Elem(int i,int j)

DESCRIPTION :

PARAMETERS :
                i    1st componet
                j    2nd componet
RETURNS : double

SEEALSO :

EXAMPLE :


Plus



PURPOSE : Tensor operation :  Tensor this + Tensor C

SYNTAX :  Tensor Plus(Tensor C)

DESCRIPTION :

PARAMETERS :
C        Added tensor
RETURNS : Tensor

SEEALSO : Minus()

EXAMPLE :


Minus



PURPOSE : Tensor operation :  Tensor this - Tensor C

SYNTAX : Tensor Minus(Tensor C)

DESCRIPTION : This method is inserted for the economy of coding, because this can be implemented by Plus  and Mult method.    i.e.     this.Plus(C.Mult(-1.))

PARAMETERS :
C        Added tensor

RETURNS : Tensor

SEEALSO : Plus()

EXAMPLE :


Mult



PURPOSE : Tensor operation :  Tensor this * Tensor C, Tensor this *Vector and Tensor*double

SYNTAX :
Tensor Mult(Tensor C)
Vector Mult(Vector V)
Tensor Mult(double a)

DESCRIPTION : Overloaded methods return different type of class depending on the result of operation.

PARAMETERS :
Tensor C
Vector V
double a
RETURNS : Tensor, double

SEEALSO :

EXAMPLE :


X_Rotate


PURPOSE : Rotation operation around X axis. Angle is given in degree.

SYNTAX : void X_Rotate(double theta)

DESCRIPTION : Right hand system is applied.

PARAMETERS : theta    rotation angle in degree

RETURNS : none

SEEALSO : Y_Rotate(),Z_Rotate()

EXAMPLE :


Y_Rotate



PURPOSE : Rotation operation around Y axis. Angle is given in degree.

SYNTAX : void Y_Rotate(double theta)

DESCRIPTION : Right hand system is applied.

PARAMETERS : theta    rotation angle in degree

RETURNS : none

SEEALSO : X_Rotate(),Z_Rotate()

EXAMPLE :


Z_Rotate



PURPOSE :  Rotation operation around Z axis. Angle is given in degree.
 

SYNTAX :void Z_Rotate(double theta)

DESCRIPTION :  Right hand system is applied.

PARAMETERS : theta    rotation angle in degree
 

RETURNS : none

SEEALSO : X_Rotate(),Z_Rotate()

EXAMPLE :
 


class Vector extends Tensor


Syntax
Vector class is for 3D vector and has vector operation methods. It is convenient for design 3D space allocation.

Description


MEMBER SUMMARY

 Vector()                    constructor
 double Get_Elem()    return string composed with the vector's elment value
 double Sproduct()     calculate scalar product
 Vector Vproduct()    calculate vector product
 Vector Plus()            openration corresponding to arithmatic "+"
 Vector Minus()          openration corresponding to arithmatic "-"
 Vector Mult()            openration corresponding to arithmatic "*"
double Abs()              absolute value of Vector
 Vector Unit()        generate unit vector parallel to the vector


Vector



PURPOSE : Constructor of Vector.

SYNTAX :
Vector(double InitY1,double InitY2,double InitY3)
Vector()
Vector(Vector Other_Vector)
DESCRIPTION :
3 components can be substituted into vector, which is most basic method to fix a vector.
The clone is generated by another vector, which may be calculated from the  methods of this or tensor class.
With no parameter, zero vector is generated.

PARAMETERS :
             InitY1, InitY2, InitY3
            Substituted into i componets
             Other_Vector        Making clone of other tensor into this instance
 
RETURNS : none

SEEALSO :

EXAMPLE :


Get_Elem



PURPOSE : Get i component of a vactor.

SYNTAX : double Get_Elem(int i)

DESCRIPTION :

PARAMETERS :
            i      number of componet
RETURNS :

SEEALSO : Tensor.Get_Elem()

EXAMPLE :


Sproduct



PURPOSE : Gives scalar product value(double) of two vectors.

SYNTAX : double Sproduct(Vector C)

DESCRIPTION :

PARAMETERS :
C                    Vector to  make with scalar product

RETURNS : double scalar product value

SEEALSO :

EXAMPLE :


Vproduct



PURPOSE : Make Vector product with other vector

SYNTAX : Vector Vproduct(Vector V)

DESCRIPTION :

PARAMETERS :
V            Vector to make with vector product

 
RETURNS : Vector

SEEALSO :

EXAMPLE :


Plus



PURPOSE :  Vector operation   Vector + Vector

SYNTAX : Vector Plus(Vector V)

DESCRIPTION :

PARAMETERS :
V            Vector
RETURNS : Vector

SEEALSO :

EXAMPLE :


Mult



PURPOSE : Vector operation   Vector * scalar,  Vector * Tensor(Direct multiplication)

SYNTAX :
Vector Mult(double a)
Tensorr Mult(Tensor C)

DESCRIPTION : Multiplication with scalar has no difference between a*V and V*a.
In case of  tensor, this operation is not compatible to C*V, which generate  a vector.

PARAMETERS :
a                 scalar to be multiplied
C                Tensor
RETURNS :
Vector
Tensor
SEEALSO :

EXAMPLE :


Abs



PURPOSE : Gives absolute value (norm) of  vector.

SYNTAX : double Abs()

DESCRIPTION :

PARAMETERS :
none
RETURNS :
double
SEEALSO :

EXAMPLE :


Unit


PURPOSE : Gives unit vector from an arbitrary length vector.

SYNTAX : Vector Unit()

DESCRIPTION : If this  vector is zero vector or nearly equal to zero vector(this.Abs() is less  than 1e-50) , this method returns new Vecto(1.,0.,0.)

PARAMETERS : none

RETURNS : Vector

SEEALSO :

EXAMPLE :
 
 


class Vector2D


Syntax
Vector2D class is for plotting on the Projection plane and world coordinate system.
It will reduce programming and coding time.

Description


MEMBER SUMMARY

Vector2D()                    constructor
 double Get_Elem()        return string composed with the vector's elment value
 double Sproduct()        calculate scalar product
 Vector2D Plus()           openration corresponding to arithmatic "+"
 Vector2D Minus()        openration corresponding to arithmatic "-"
 Vector 2DMult()          openration corresponding to arithmatic "*"
Vector2D Rot()            Rotate 2D vector in degree counter clockwise
double Abs()                 sbsolute value of Vector2D
 Vector2D Unit()           generate unit vector parallel to the vector2D

 
 


Vector2D



PURPOSE : Constructor

SYNTAX :
Vector2D()
Vector2D(double InitY1,double InitY2)
Vector2D(Vector2D Other_Vector)
DESCRIPTION :
2 dimensional vector is mainly applied to projection plane and used for plotting in world corrdinate.
In case of no parameter, it gives zero vector.
2 components can be substituted into 2D vector, which is most basic method to fix a 2D vector.
The clone is generated by another 2D vector.
With no parameter, zero vector is generated.
PARAMETERS :
InitX
InitY
Other_Vector
RETURNS : none

SEEALSO : Vector class

EXAMPLE :


Get_Elem



PURPOSE : Get i component of a vactor.

SYNTAX : double Get_Elem(int i)

DESCRIPTION :

PARAMETERS :
            i      number of componet
RETURNS :

SEEALSO : Tensor.Get_Elem()

EXAMPLE :


Sproduct



PURPOSE : Gives scalar product value(double) of two vectors.

SYNTAX : double Sproduct(Vector2D C)

DESCRIPTION :

PARAMETERS :
C                    Vector to  make with scalar product

RETURNS : double scalar product value

SEEALSO :

EXAMPLE :


Plus



PURPOSE : Vector operation   Vector + Vector

SYNTAX : Vector Plus(Vector V)

DESCRIPTION :

PARAMETERS :
V            Vector
RETURNS : Vector

SEEALSO :

EXAMPLE :


Mult



PURPOSE : Vector operation   Vector * scalar

SYNTAX :
Vector2D Mult(double a)

DESCRIPTION : Multiplication with scalar

PARAMETERS :
a                 scalar to be multiplied
RETURNS :
Vector
SEEALSO :

EXAMPLE :


Rot



PURPOSE : Rotation operation of a 2D vector in its plane, which Gives new 2D vector.

SYNTAX : Vector2D Rot(double degree)

DESCRIPTION :

PARAMETERS :
degree        rotation angle in degree measured by counter clockwise
RETURNS :
Vector2D
SEEALSO :

EXAMPLE :


Abs



PURPOSE : Gives absolute value(norm) of 2D vector.

SYNTAX : double Abs()

DESCRIPTION :

PARAMETERS :
none
RETURNS :
double
SEEALSO :

EXAMPLE :


Unit


PURPOSE : Gives unit vector from an arbitrary length vector.

SYNTAX : Vector2D Unit()

DESCRIPTION : If this 2D vector is zero vector or nearly equal to zero vector(this.Abs() is less  than 1e-50) , this method returns new Vector2D(1.,0.)

PARAMETERS : none

RETURNS : Vector2D

SEEALSO :

EXAMPLE :