GO2cam Javascript API  6.11
GO2SMatrix Class Reference

Class for the 4x4 matrix. More...

Inherits QObject, and CGoeMatricePlan.

Public Member Functions

 GO2SMatrix ()
 Create the identity matrix.
 
 GO2SMatrix (GO2SXYZ vect)
 see GO2SMatrix.DefineFromVector
 
 GO2SMatrix (GO2SXYZ Vx, GO2SXYZ Vy, GO2SXYZ Vz, GO2SXYZ Vc)
 Create a matrix from 4 vectors (x, y, z axis and position)
 
 GO2SMatrix (Number destination, Number source)
 Create a matrix defining the transformation from a plane to another.
 
GO2SEnum::GO2SError DefineCenteredSymmetry2D (GO2SXYZ centre, GO2SXYZ NormalPlane=new GO2SXYZ(0, 0, 1))
 
GO2SEnum::GO2SError DefineCenteredSymmetry3D (GO2SXYZ centre)
 
GO2SEnum::GO2SError DefineFromVector (GO2SXYZ thisVector)
 
GO2SEnum::GO2SError DefineFromVectorAndOrigin (GO2SXYZ thisVector, GO2SXYZ origin)
 
void DefineIdentity ()
 Initialize to identity matrix.
 
GO2SEnum::GO2SError DefineRotation (GO2SXYZ axe, Number ang)
 
GO2SEnum::GO2SError DefineRotation (GO2SXYZ centre, GO2SXYZ axe, Number ang)
 
void DefineRotationX (Number ang)
 Define a rotation around X axis.
 
void DefineRotationY (Number ang)
 Define a rotation around Y axis.
 
void DefineRotationZ (Number ang)
 Define a rotation around Z axis.
 
void DefineRotationZYX (Number angZ, Number angY, Number angX)
 
GO2SEnum::GO2SError DefineSymmetry (GO2SXYZ centre, GO2SXYZ TransAxe, GO2SXYZ NormalAxe=new GO2SXYZ(0, 0, 1))
 
GO2SEnum::GO2SError DefineSymmetryByPlane (GO2SXYZ centre, GO2SXYZ NormalPlane)
 
GO2SEnum::GO2SError DefineTransferVector (GO2SXYZ vecFrom, GO2SXYZ vecTo, GO2SXYZ oriFrom, GO2SXYZ oriTo, GO2SXYZ refFrom, GO2SXYZ refTo)
 
GO2SEnum::GO2SError DefineTranslation (GO2SXYZ tr)
 
Number Determinant ()
 
GO2SMatrix GetComatrix ()
 
GO2SEnum::GO2SError Invert ()
 
GO2SMatrix Inverted ()
 
Boolean IsIdentity ()
 
Boolean IsInvertible ()
 
Boolean IsSingular ()
 
GO2SMatrix Multiply (GO2SMatrix other)
 Get the result of the multiplication of two matrix.
 
GO2SXYZ MultiplyPoint (GO2SXYZ xyz)
 Apply the matrix to xyz, considering xyz is a point.
 
GO2SXYZ MultiplyVector (GO2SXYZ xyz)
 Apply the matrix to xyz, considering xyz is a vector.
 
GO2SXYZ Origin ()
 
GO2SEnum::GO2SError SetOrigin (GO2SXYZ po)
 
GO2SEnum::GO2SError SetXaxis (GO2SXYZ ax)
 
GO2SEnum::GO2SError SetYaxis (GO2SXYZ ay)
 
GO2SEnum::GO2SError SetZaxis (GO2SXYZ az)
 
GO2SEnum::GO2SError Translate (GO2SXYZ vect)
 
void Transpose ()
 Transpose the matrix.
 
GO2SMatrix Transposed ()
 
GO2SXYZ XAxis ()
 
GO2SXYZ YAxis ()
 
GO2SXYZ ZAxis ()
 

Detailed Description

Class for the 4x4 matrix.

Constructor & Destructor Documentation

◆ GO2SMatrix() [1/2]

GO2SMatrix::GO2SMatrix ( Number destination,
Number source )
inline

Create a matrix defining the transformation from a plane to another.

Parameters
[in]destinationdestination plane
[in]sourcesource plane

◆ GO2SMatrix() [2/2]

GO2SMatrix::GO2SMatrix ( GO2SXYZ Vx,
GO2SXYZ Vy,
GO2SXYZ Vz,
GO2SXYZ Vc )

Create a matrix from 4 vectors (x, y, z axis and position)

Parameters
[in]Vx1st column (x axis)
[in]Vy2nd column (y axis)
[in]Vz3rd column (z axis)
[in]Vc4th column (position)

Member Function Documentation

◆ DefineCenteredSymmetry2D()

GO2SEnum::GO2SError GO2SMatrix::DefineCenteredSymmetry2D ( GO2SXYZ centre,
GO2SXYZ NormalPlane = new GO2SXYZ(0, 0, 1) )

Define a centered symetry in 2D

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]centreCenter of symmetry
[in]NormalPlanevisual direction ( would be Z)

◆ DefineCenteredSymmetry3D()

GO2SEnum::GO2SError GO2SMatrix::DefineCenteredSymmetry3D ( GO2SXYZ centre)

Define a centered symetry in 3D

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]centreCenter of symmetry

◆ DefineFromVector()

GO2SEnum::GO2SError GO2SMatrix::DefineFromVector ( GO2SXYZ thisVector)

Define a matrix with Z vector equal to thisVector, X and Y vectors are created automatically

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]thisVectorz vector on which align Z of the plane

◆ DefineFromVectorAndOrigin()

GO2SEnum::GO2SError GO2SMatrix::DefineFromVectorAndOrigin ( GO2SXYZ thisVector,
GO2SXYZ origin )

Define a matrix using origin with Z vector equal to thisVector, X and Y vectors are created automatically

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]thisVectorz vector on which align Z of the plane
[in]originnew origin of the plane

◆ DefineRotation() [1/2]

GO2SEnum::GO2SError GO2SMatrix::DefineRotation ( GO2SXYZ axe,
Number ang )

Define a rotation around a given axis. The angle is given in radian

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]axeRotation axis
[in]angRotation angle in radian

◆ DefineRotation() [2/2]

GO2SEnum::GO2SError GO2SMatrix::DefineRotation ( GO2SXYZ centre,
GO2SXYZ axe,
Number ang )

Define a rotation around given point and axis. The angle is given in radian

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]centrePosition of the rotation axis
[in]axeRotation axis
[in]angRotation angle in radian

◆ DefineRotationX()

void GO2SMatrix::DefineRotationX ( Number ang)
inline

Define a rotation around X axis.

Parameters
[in]angThe angle in radian

◆ DefineRotationY()

void GO2SMatrix::DefineRotationY ( Number ang)
inline

Define a rotation around Y axis.

Parameters
[in]angThe angle in radian

◆ DefineRotationZ()

void GO2SMatrix::DefineRotationZ ( Number ang)
inline

Define a rotation around Z axis.

Parameters
[in]angThe angle in radian

◆ DefineRotationZYX()

void GO2SMatrix::DefineRotationZYX ( Number angZ,
Number angY,
Number angX )
inline

Define a rotation around the 3 axis. The rotation is done around X, then around Y, then around Z (R = RzRyRx). Angles are given in radian

Parameters
[in]angZangle around Z axis in radian
[in]angYangle around y axis in radian
[in]angXangle around X axis in radian

◆ DefineSymmetry()

GO2SEnum::GO2SError GO2SMatrix::DefineSymmetry ( GO2SXYZ centre,
GO2SXYZ TransAxe,
GO2SXYZ NormalAxe = new GO2SXYZ(0, 0, 1) )

Define a symmetry according to the face plane given

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]centrePosition of the symmetry plane
[in]TransAxeAxe of the plane (would be the ovious 2D)
[in]NormalAxeOther axe of the plane, visual direction ( would be Z)

◆ DefineSymmetryByPlane()

GO2SEnum::GO2SError GO2SMatrix::DefineSymmetryByPlane ( GO2SXYZ centre,
GO2SXYZ NormalPlane )

Define a symmetry according to the face plane given

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]centrePosition of the symmetry plane
[in]NormalPlaneNormal to the plane, visual direction ( would be Z)

◆ DefineTransferVector()

GO2SEnum::GO2SError GO2SMatrix::DefineTransferVector ( GO2SXYZ vecFrom,
GO2SXYZ vecTo,
GO2SXYZ oriFrom,
GO2SXYZ oriTo,
GO2SXYZ refFrom,
GO2SXYZ refTo )

Define a transformation matrix that aligns a vectors and positions

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]vecFromdestination vector for vecTo
[in]vecTovector that will be aligned on vecFrom
[in]oriFromdestination position
[in]oriTooriginal position
[in]refFromdestination vector for refTo
[in]refTovector that will be aligned on refFrom

◆ DefineTranslation()

GO2SEnum::GO2SError GO2SMatrix::DefineTranslation ( GO2SXYZ tr)

Define a translation matrix (the rotation part is set to identity)

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]trtranslation vector

◆ Determinant()

Number GO2SMatrix::Determinant ( )
inline
Returns
the determinant of the matrix

◆ GetComatrix()

GO2SMatrix GO2SMatrix::GetComatrix ( )
inline
Returns
the comatrix

◆ Invert()

GO2SEnum::GO2SError GO2SMatrix::Invert ( )

Invert the matrix if invertible

Returns
GO2SError.success if the matrix is inverted, see GO2SError otherwise

◆ Inverted()

GO2SMatrix GO2SMatrix::Inverted ( )
inline
Returns
the inverted matrix if is invertible, null otherwise

◆ IsIdentity()

Boolean GO2SMatrix::IsIdentity ( )
inline
Returns
if the matrix is identity

◆ IsInvertible()

Boolean GO2SMatrix::IsInvertible ( )
inline
Returns
if the matrix is invertible

◆ IsSingular()

Boolean GO2SMatrix::IsSingular ( )
inline
Returns
if the matrix is singular

◆ Multiply()

GO2SMatrix GO2SMatrix::Multiply ( GO2SMatrix other)
inline

Get the result of the multiplication of two matrix.

Parameters
[in]otherthe second matrix

◆ MultiplyPoint()

GO2SXYZ GO2SMatrix::MultiplyPoint ( GO2SXYZ xyz)
inline

Apply the matrix to xyz, considering xyz is a point.

Parameters
[in]xyzthe point

◆ MultiplyVector()

GO2SXYZ GO2SMatrix::MultiplyVector ( GO2SXYZ xyz)
inline

Apply the matrix to xyz, considering xyz is a vector.

Parameters
[in]xyzthe vector

◆ Origin()

GO2SXYZ GO2SMatrix::Origin ( )
inline
Returns
the 4th column

◆ SetOrigin()

GO2SEnum::GO2SError GO2SMatrix::SetOrigin ( GO2SXYZ po)

Set the translation vector (last column) of the matrix. Other values are unchanged.

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]ponew origin

◆ SetXaxis()

GO2SEnum::GO2SError GO2SMatrix::SetXaxis ( GO2SXYZ ax)

Set the X vector (1st column) of the matrix. Other values are unchanged.

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]axnew X axis

◆ SetYaxis()

GO2SEnum::GO2SError GO2SMatrix::SetYaxis ( GO2SXYZ ay)

Set the Y vector (2nd column) of the matrix. Other values are unchanged.

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]aynew Y axis

◆ SetZaxis()

GO2SEnum::GO2SError GO2SMatrix::SetZaxis ( GO2SXYZ az)

Set the Z vector (3rd column) of the matrix. Other values are unchanged.

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]aznew Z axis

◆ Translate()

GO2SEnum::GO2SError GO2SMatrix::Translate ( GO2SXYZ vect)

Apply a translation to the matrix

Returns
GO2SError.success if success, see GO2SError otherwise
Parameters
[in]vecttranslation vector

◆ Transposed()

GO2SMatrix GO2SMatrix::Transposed ( )
inline
Returns
a new matrix that is the transposed of the current matrix

◆ XAxis()

GO2SXYZ GO2SMatrix::XAxis ( )
inline
Returns
the 1st column

◆ YAxis()

GO2SXYZ GO2SMatrix::YAxis ( )
inline
Returns
the 2nd column

◆ ZAxis()

GO2SXYZ GO2SMatrix::ZAxis ( )
inline
Returns
the 3rd column