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.
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 :
SYNTAX : double Get_Elem(int i,int j)
DESCRIPTION :
PARAMETERS :
i 1st componet
j 2nd componet
RETURNS : double
SEEALSO :
EXAMPLE :
SYNTAX : Tensor Plus(Tensor C)
DESCRIPTION :
PARAMETERS :
C Added tensor
RETURNS : Tensor
SEEALSO : Minus()
EXAMPLE :
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 :
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 :
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 :
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 :
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 :
Syntax
Vector class is for 3D vector and has vector operation methods. It
is convenient for design 3D space allocation.
Description
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 :
SYNTAX : double Get_Elem(int i)
DESCRIPTION :
PARAMETERS :
i number of componet
RETURNS :
SEEALSO : Tensor.Get_Elem()
SYNTAX : double Sproduct(Vector C)
DESCRIPTION :
PARAMETERS :
C
Vector to make with scalar product
RETURNS : double scalar product value
SEEALSO :
EXAMPLE :
SYNTAX : Vector Vproduct(Vector V)
DESCRIPTION :
PARAMETERS :
V
Vector to make with vector product
RETURNS : Vector
SEEALSO :
EXAMPLE :
SYNTAX : Vector Plus(Vector V)
DESCRIPTION :
PARAMETERS :
V
Vector
RETURNS : Vector
SEEALSO :
EXAMPLE :
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 :
SYNTAX : double Abs()
DESCRIPTION :
PARAMETERS :
none
RETURNS :
double
SEEALSO :
EXAMPLE :
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 :
Syntax
Vector2D class is for plotting on the Projection plane and world coordinate
system.
It will reduce programming and coding time.
Description
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 :
SYNTAX : double Get_Elem(int i)
DESCRIPTION :
PARAMETERS :
i number of componet
RETURNS :
SEEALSO : Tensor.Get_Elem()
EXAMPLE :
SYNTAX : double Sproduct(Vector2D C)
DESCRIPTION :
PARAMETERS :
C
Vector to make with scalar product
RETURNS : double scalar product value
SEEALSO :
EXAMPLE :
SYNTAX : Vector Plus(Vector V)
DESCRIPTION :
PARAMETERS :
V
Vector
RETURNS : Vector
SEEALSO :
EXAMPLE :
SYNTAX :
Vector2D Mult(double a)
DESCRIPTION : Multiplication with scalar
PARAMETERS :
a
scalar to be multiplied
RETURNS :
Vector
SEEALSO :
EXAMPLE :
SYNTAX : Vector2D Rot(double degree)
DESCRIPTION :
PARAMETERS :
degree rotation angle in
degree measured by counter clockwise
RETURNS :
Vector2D
SEEALSO :
EXAMPLE :
SYNTAX : double Abs()
DESCRIPTION :
PARAMETERS :
none
RETURNS :
double
SEEALSO :
EXAMPLE :
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 :