Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,323 @@
/*--------------------------------*/
/* Conversion of numericals types */
/*--------------------------------*/
/* Version 1.0 */
/* Author : S Leroy */
/* Date : 5/03/98 */
/* Modification : 9/03/98 */
/*--------------------------------*/
/* PC Version by M Trabucato */
/*--------------------------------*/
/* Conversion : OK (avec version 27.04.98 11:35 (22582) */
/*--------------------------------*/
#ifndef _3DCONV_H_
#define _3DCONV_H_
#include "MTH\Specif\VEC\sl12_3D.h"
#include "MTH\Specif\VEC\sl_3D.h"
#include "MTH\Specif\VEC\sw12_3D.h"
#include "MTH\Specif\VEC\sw_3D.h"
#include "MTH\Specif\SCA\converse.h"
/*--------------------------------------*/
/* 2D Vector Outer Product */
/*--------------------------------------*/
__inline SCA_td_sl sl_fn_2DOuterProduct(
SCA_td_sl x0,
SCA_td_sl y0,
SCA_td_sl x1,
SCA_td_sl y1,
SCA_td_sl x2,
SCA_td_sl y2
)
{
return MTH_M_xAdd3( MTH_M_xMul( x0 , MTH_M_xSub( y1 , y2 ) ) ,
MTH_M_xMul( x1 , MTH_M_xSub( y2 , y0 ) ) ,
MTH_M_xMul( x2 , MTH_M_xSub( y0 , y1 ) ) );
}
/*--------------------------------------------*/
/* Vector Conversion */
/*--------------------------------------------*/
/* Vector Normalisation */
__inline sw12_3D_tdstVector * VEC_p_sw12_3DNormalise_sl3D(
sw12_3D_tdstVector * _p_stsw12_3D_Dest,
sw12_3D_tdstVector * _p_stsl3_DSrc
)
{
MTH3D_M_vNormalizeVector(_p_stsw12_3D_Dest,_p_stsl3_DSrc);
return _p_stsw12_3D_Dest;
}
/*------------------------------*/
/* sw12_3D <- Normalise (sl_3D) */
/*------------------------------*/
__inline sw12_3D_tdstVector * VEC_p_sw12_3DNormalize_sw3D(
sw12_3D_tdstVector * _p_stsw12_3D_Dest,
sw_3D_tdstVector * _p_stsw_3DSrc
)
{
MTH3D_M_vNormalizeVector(_p_stsw12_3D_Dest,_p_stsw_3DSrc);
return _p_stsw12_3D_Dest;
}
/*--------------------------------*/
/* sw12_3D <- Normalise (sl12_3D) */
/*--------------------------------*/
__inline sw12_3D_tdstVector * VEC_p_sw12_3DNormalize_sl123D(
sw12_3D_tdstVector * _p_stsw12_3D_Dest,
sl12_3D_tdstVector * _p_stsl12_3DSrc
)
{
MTH3D_M_vNormalizeVector(_p_stsw12_3D_Dest,_p_stsl12_3DSrc);
return _p_stsw12_3D_Dest;
}
/*--------------------------------*/
/* Vector Normalisation functions */
/*--------------------------------*/
#define sw12_3D_vNormalizeVector_Dsw12_Ssl(VectDest, VectA) VEC_p_sw12_3DNormalize_sl3D(VectDest, VectA)
#define sw12_3D_vNormalizeVector_Dsw12_Ssl12(VectDest, VectA) VEC_p_sw12_3DNormalize_sl123D(VectDest, VectA)
#define sw12_3D_vNormalizeVector_Dsw12_Ssw(VectDest, VectA) VEC_p_sw12_3DNormalize_sw3D(VectDest, VectA)
#define sw12_3D_vNormalizeVector_Dsw12_Ssw12(VectDest, VectA) VEC_p_sw12_3DNormalize_sw3D(VectDest, VectA)
/*--------------------------------------------*/
/* Vector Conversion */
/*--------------------------------------------*/
/* Conversion sw3D in sl3D */
__inline sl_3D_tdstVector * VEC_p_sw3DConverse_sw3DTosl3D(
sl_3D_tdstVector * _p_stsl3DDest,
sw_3D_tdstVector * _p_stsw3DSrc
)
{
MTH3D_M_vCopyVector(_p_stsl3DDest,_p_stsw3DSrc);
return _p_stsl3DDest;
}
/* Conversion sl3D in sw3D */
__inline sw_3D_tdstVector * VEC_p_sw3DConverse_sl3DTosw3D(
sw_3D_tdstVector * _p_stsw3DDest,
sl_3D_tdstVector * _p_stsl3DSrc
)
{
MTH3D_M_vCopyVector(_p_stsw3DDest,_p_stsl3DSrc);
return _p_stsw3DDest;
}
/*--------------------------------------------*/
/* Vector/Matrix Multiplication */
/*--------------------------------------------*/
/* Specific functions */
/* PC OK */
__inline void sw12_3D_fn_vMulMatrixVector_Dsl_SswWithoutBuffer(
sl_3D_tdstVector * p_VectDest,
sw12_3D_tdstMatrix * p_MatA,
sw_3D_tdstVector * p_VectA)
{
MTH3D_M_vMulMatrixVectorWithoutBuffer(p_VectDest,p_MatA,p_VectA);
}
/* Explicit name */
/* To be optimzed of course */
/* PC OK */
__inline void sw12_3D_fn_vMulMatrixSw12Vector_Dsl_Ssl(
sl_3D_tdstVector * p_VectDest,
sw12_3D_tdstMatrix * p_MatA,
sl_3D_tdstVector * p_VectA)
{
MTH3D_M_vMulMatrixVectorWithoutBuffer(p_VectDest,p_MatA,p_VectA);
}
/*-------------------------------------------------------------------------------------------*/
/* Mul Add Vector */
/*-------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
/* sw_3D_M_vMulAddVector( sw_3D, sl12, sw_3D, sw_3D) sw_3D = sl12*sw_3D + sw_3D */
/*--------------------------------------------------------------------------------*/
/* PC OK */
__inline void sw_3D_fn_vMulAddVector_sw3D_sl12_sw3D_sw_3D(
sw_3D_tdstVector * _p_stswVectorResult,
td_sl12 _sl12_scalar,
sw_3D_tdstVector * _p_stswVectorA,
sw_3D_tdstVector * _p_stswVectorB
)
{
MTH3D_M_vMulScalarVector( _p_stswVectorResult, _sl12_scalar, _p_stswVectorA);
MTH3D_M_vAddVector( _p_stswVectorResult, _p_stswVectorResult, _p_stswVectorB);
}
/*----------------------------------------------------------------------------------*/
/* sl_3D_M_vMulAddVector : sl_3D <- sw * sw12_3D + sl_3D */
/*----------------------------------------------------------------------------------*/
__inline void sl_3D_fn_vMulAddVector_sl3D_sw_sw123D_sl3D(
sl_3D_tdstVector * _p_stslVectorResult,
td_sw _sw_scalar,
sw12_3D_tdstVector * _p_stsw12VectorA,
sl_3D_tdstVector * _p_stslVectorB
)
{
MTH3D_M_vMulScalarVector( _p_stslVectorResult, _sw_scalar, _p_stsw12VectorA);
MTH3D_M_vAddVector( _p_stslVectorResult, _p_stslVectorResult, _p_stslVectorB);
}
/*----------------------------------------------------------------------------------*/
/* sl_3D_M_vMulAddVector : sl_3D <- sw12 * sw_3D + sl_3D */
/*----------------------------------------------------------------------------------*/
#define sl_3D_M_vMulAddVector_sl3D_sw12_sw3D_sl3D( _p_sl_3DResult, _sw12, _p_sw_3D, _p_sl_3D) \
{ \
MTH3D_M_vMulScalarVector( _p_sl_3DResult, _sw12, _p_sw_3D); \
MTH3D_M_vAddVector( _p_sl_3DResult, _p_sl_3DResult, _p_sl_3D); \
}
/*----------------------------------------------------------------------------------*/
/* sl_3D_M_vMulAddVector : sw_3D <- sw * sw12_3D + sw_3D */
/*----------------------------------------------------------------------------------*/
#define sw_3D_M_vMulAddVector_sw3D_sw_sw123D_sw3D( _p_sw_3DResult, _sw, _p_sw12_3D, _p_sw_3D) \
{ \
MTH3D_M_vMulScalarVector( _p_sw_3DResult, _sw, _p_sw12_3D); \
MTH3D_M_vAddVector( _p_sw_3DResult, _p_sw_3DResult, _p_sw_3D); \
}
#define sl_3D_M_vMulAddVector_sl3D_sw_sw123D_sl3D( sl_3DResult, sw, sw12_3D, sl_3D) sl_3D_fn_vMulAddVector_sl3D_sw_sw123D_sl3D( sl_3DResult, sw, sw12_3D, sl_3D)
#define sw_3D_M_vMulAddVector_sw3D_sl12_sw3D_sw3D( sw_3DResult, sl12, sw_3D_1, sw_3D_2) sw_3D_fn_vMulAddVector_sw3D_sl12_sw3D_sw3D( sw_3DResult, sl12, sw_3D_1, sw_3D_2)
/*-------------------------------------------------------------------------------------------*/
/* Dot Products */
/*-------------------------------------------------------------------------------------------*/
/*----------------------------------------------*/
/* sw_3D_M_xDotProductVector ( sw_3D, sw12_3D ) */
/*----------------------------------------------*/
/* PC OK */
__inline td_sl VEC_3D_fn_sl_DotProductVector_sw_sw(
sw_3D_tdstVector * _p_stswVectorA,
sw_3D_tdstVector * _p_stswVectorB
)
{
return MTH3D_M_xDotProductVector(_p_stswVectorA,_p_stswVectorB);
}
/*--------------------------------------------------------*/
/* sw_3D_M_sw_DotProductVector_sw_sw12 ( sw_3D, sw12_3D ) */
/*--------------------------------------------------------*/
__inline td_sw VEC_3D_fn_sw_DotProductVector_sw_sw12(
sw_3D_tdstVector * _p_stswVector,
sw12_3D_tdstVector * _p_stsw12Vector
)
{
return MTH3D_M_xDotProductVector(_p_stswVector,_p_stsw12Vector);
}
/*--------------------------------------------------------*/
/* sw_3D_M_sl_DotProductVector_sl_sw12 ( sl_3D, sw12_3D ) */
/*--------------------------------------------------------*/
__inline td_sl VEC_3D_fn_sl_DotProductVector_sl_sw12(
sl_3D_tdstVector * _p_stslVector,
sw12_3D_tdstVector * _p_stsw12Vector
)
{
return MTH3D_M_xDotProductVector(_p_stslVector,_p_stsw12Vector);
}
#define VEC_3D_M_sl_DotProductVector_sw_sw( sw_3D_1, sw_3D_2 ) VEC_3D_fn_sl_DotProductVector_sw_sw( sw_3D_1, sw_3D_2 )
#define VEC_3D_M_sw_DotProductVector_sw_sw12( sw_3D, sw12_3D ) VEC_3D_fn_sw_DotProductVector_sw_sw12( sw_3D, sw12_3D )
#define VEC_3D_M_sl_DotProductVector_sl_sw12( sl_3D, sw12_3D ) VEC_3D_fn_sl_DotProductVector_sl_sw12( sl_3D, sw12_3D )
/*------------------------------------------------------------------------------------------------------------------------*/
/* Mul Scalar Vector */
/*------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------*/
/* MulScalar sw_3D <- sl12 * sw_3D */
/*----------------------------------------------*/
/* PC OK */
__inline sw_3D_tdstVector * sw_3D_fn_MulScalarVector_sl12_Sw3D
(
sw_3D_tdstVector * _p_stswVectorResult,
td_sl12 _p_s12Scalar,
sw_3D_tdstVector * _p_stswVector
)
{
MTH3D_M_vMulScalarVector( _p_stswVectorResult, _p_s12Scalar, _p_stswVector);
return _p_stswVectorResult;
}
/*----------------------------------------------*/
/* MulScalar sw_3D <- sw * sw12_3D */
/*----------------------------------------------*/
__inline sw_3D_tdstVector * sw_3D_fn_MulScalarVector_sw_sw123D
(
sw_3D_tdstVector * _p_stswVectorResult,
td_sw swScalar,
sw12_3D_tdstVector * _p_stsw12Vector
)
{
MTH3D_M_vMulScalarVector( _p_stswVectorResult, swScalar, _p_stsw12Vector);
return _p_stswVectorResult;
}
#define sw_3D_M_MulScalarVector_sw_sw123D(Vectd,a,VectA) sw_3D_fn_MulScalarVector_sw_sw123D(Vectd,a,VectA)
#define sw_3D_M_MulScalarVector_sl12_sw3D(Vectd,a,VectA) sw_3D_fn_MulScalarVector_sl12_sw3D(Vectd,a,VectA)
/*------------------------------------------------------------------------------------------------------------------------*/
/* Div Vector Scalar */
/*------------------------------------------------------------------------------------------------------------------------*/
/*-----------------------*/
/* sw12_3D <- sw_3D / sw */
/*-----------------------*/
__inline sw12_3D_tdstVector * sw12_3D_fn_VectorDivScalar_sw3D_sw
(
sw12_3D_tdstVector * _p_stsw12VectorResult,
sw_3D_tdstVector * _p_stswVector,
td_sw swScalar
)
{
MTH3D_M_vDivScalarVector( _p_stsw12VectorResult, _p_stswVector, swScalar);
return _p_stsw12VectorResult;
}
#define sw12_3D_M_VectorDivScalar_sw3D_sw(Vectd,Vecta,a) sw12_3D_fn_VectorDivScalar_sw3D_sw(Vectd,Vecta,a)
/*------------------------------------------------------------*/
/* Square norm of a vector */
/*------------------------------------------------------------*/
__inline td_sl sw_3D_fn_sl_SqrVector(
sw_3D_tdstVector * _p_stswVectorA
)
{
return MTH3D_M_xSqrVector(_p_stswVectorA);
}
#define sw_3D_M_sl_SqrVector_sw(VectA) sw_3D_fn_sl_SqrVector(VectA)
/*--------------------------------*/
/* Vector Normalisation functions */
/*--------------------------------*/
#define sw12_3D_vNormalizeVector_Dsw12_Ssl(VectDest, VectA) VEC_p_sw12_3DNormalize_sl3D(VectDest, VectA)
#define sw12_3D_vNormalizeVector_Dsw12_Ssl12(VectDest, VectA) VEC_p_sw12_3DNormalize_sl123D(VectDest, VectA)
#define sw12_3D_vNormalizeVector_Dsw12_Ssw(VectDest, VectA) VEC_p_sw12_3DNormalize_sw3D(VectDest, VectA)
#define sw12_3D_vNormalizeVector_Dsw12_Ssw12(VectDest, VectA) VEC_p_sw12_3DNormalize_sw3D(VectDest, VectA)
/*---------------------------------------------*/
/* sl <- sl_3D_M_slVectorGapSqr (sw_3D, sw_3D) */
/*---------------------------------------------*/
#define sl_3D_M_slVectorGapSqr_sw3D_sw3D(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
/*-----------------------------------------------------*/
/* ul <- VEC_M_ulVectorGapSqr_sl3D_sl3D (sl_3D, sl_3D) */
/*-----------------------------------------------------*/
__inline unsigned long VEC_fn_ulVectorGapSqr_sl3D_sl3D(
sl_3D_tdstVector *_p_stsl3D_A,
sl_3D_tdstVector *_p_stsl3D_B
)
{
return MTH_M_xRealToLong(MTH3D_M_xVectorGapSqr(_p_stsl3D_A, _p_stsl3D_B));
}
#define VEC_M_ulVectorGapSqr_sl3D_sl3D(sl_3D_1, sl_3D_2) VEC_fn_ulVectorGapSqr_sl3D_sl3D(sl_3D_1, sl_3D_2)
/* Macro definitions */
#define sw12_3D_M_vMulMatrixSw12Vector_Dsw_Ssl( VectDest, MatA, VectA) sw12_3D_fn_vMulMatrixSw12Vector_Dsl_Ssl( VectDest, MatA, VectA)
#define sw12_3D_M_vMulMatrixVector_Dsl_SswWithoutBuffer( VectDest, MatA, VectA) sw12_3D_fn_vMulMatrixVector_Dsl_SswWithoutBuffer( VectDest, MatA, VectA)
#define Conv_sl3DTosw3D(_p_stsl3D,_p_stsw3D) VEC_p_sw3DConverse_sl3DTosw3D(_p_stsl3D,_p_stsw3D)
#define Conv_sw3DTosl3D(_p_stsw3D,_p_stsl3D) VEC_p_sw3DConverse_sw3DTosl3D(_p_stsw3D,_p_stsl3D)
#endif

View File

@@ -0,0 +1,439 @@
/* ##H_FILE#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FILE : sl12_3D.h
MODULE : sl12 (Common Mathematic Library)
DESCRIPTION : 3D Vectorial implementation
VERSION : sl12 V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
VERSION PC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* -----------------15/04/98 18:36-------------------
* Conversion : OK avec version 23.04.98 19:58 31153
* --------------------------------------------------*/
#ifndef _SCA_sl12_3D_H_
#define _SCA_sl12_3D_H_
#include "MTH\Specif\SCA\SCA_sl12.h"
/* ##TYPEDEF#----------------------------------------------------------------------------
Types definition
---------------------------------------------------------------------------------------*/
/* 3D Vector : */
/*
#if 0
typedef VECTOR sl12_3D_tdstVector;
#else
typedef struct sl12_3D_tdstVector_
{
SCA_td_sl12 xX;
SCA_td_sl12 xY;
SCA_td_sl12 xZ;
SCA_td_sl12 pad;
} sl12_3D_tdstVector;
#endif
*/
#define sl12_3D_tdstVector MTH3D_tdstVector
/* 3D Matrix */
/*
typedef struct sl12_3D_tdstMatrix_
{
sl12_3D_tdstVector stCol_0;
sl12_3D_tdstVector stCol_1;
sl12_3D_tdstVector stCol_2;
} sl12_3D_tdstMatrix;
*/
#define sl12_3D_tdstMatrix MTH3D_tdstMatrix
/* ##MACRO#----------------------------------------------------------------------------
MACRO definition
---------------------------------------------------------------------------------------*/
/*+ ##-######################################
## MACRO AND FUNCTION FOR 3D MATHEMATICS
######################################### */
/* ##-###########################
## Vector Operations
############################## */
/* ##M==================================================================================
NAME : sl12_3D_M_vAddVector
DESCRIPTION : Add two vectors : VectDest= VectA + VectB
INPUT : VectDest, VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vAddVector( VectDest, VectA, VectB) MTH3D_M_vAddVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_vSubVector
DESCRIPTION : Sub two vectors : VectDest= VectA - VectB
INPUT : VectDest, VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSubVector( VectDest, VectA, VectB) MTH3D_M_vSubVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_vNegVector
DESCRIPTION : Negation of a vector : VectDest= - VectA
INPUT : VectDest, VectA : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vNegVector( VectDest, VectA) MTH3D_M_vNegVector( VectDest, VectA)
/* ##M==================================================================================
NAME : sl12_3D_M_bEqualVector
DESCRIPTION : Test if two vectors are equal
INPUT : VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : VectA==VectB : Boolean
=======================================================================================*/
#define sl12_3D_M_bEqualVector( VectA, VectB) MTH3D_M_bEqualVector( VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_vAddScalarVector
DESCRIPTION : Add a scalare with a vector : VectDest= a.Id + VectA
INPUT : VectDest: address of sl12_3D_tdstVector,
a: SCA_td_sl12, VectA: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vAddScalarVector( VectDest, a, VectA) MTH3D_M_vAddScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sl12_3D_M_vSubScalarVector
DESCRIPTION : Add a scalare with a vector : VectDest= VectA - a.Id
INPUT : VectDest: address of sl12_3D_tdstVector,
a: SCA_td_sl12, VectA: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSubScalarVector( VectDest, a, VectA) MTH3D_M_vSubScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sl12_3D_M_vMulScalarVector
DESCRIPTION : Multiplicate a scalare with a vector : VectDest= a*VectA
INPUT : VectDest: address of sl12_3D_tdstVector,
a: SCA_td_sl12, VectA: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vMulScalarVector( VectDest, a, VectA) MTH3D_M_vMulScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sl12_3D_M_vDivScalarVector
DESCRIPTION : Divide a vector by a scalare : VectDest= VectA/a
INPUT : VectDest, VectA: address of sl12_3D_tdstVector, a: SCA_td_sl12
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vDivScalarVector( VectDest, VectA, a) MTH3D_M_vDivScalarVector( VectDest, VectA, a)
/* ##M==================================================================================
NAME : sl12_3D_M_xDotProductVector
DESCRIPTION : Return the Dot Product of two vectors
INPUT : VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : VectA.VectB : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xDotProductVector( VectA, VectB) MTH3D_M_xDotProductVector( VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_vCrossProductVectorWithoutBuffer
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB,
VectDest must be a other vector
INPUT : VectDest, VectA, VectA: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_fn_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB) \
MTH3D_M_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB)
#define sl12_3D_M_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB) \
sl12_3D_fn_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_vCrossProductVector
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB
INPUT : VectDest, VectA, VectA: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vCrossProductVector(VectDest,VectA,VectB) MTH3D_M_vCrossProductVector(VectDest,VectA,VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_xSqrVector
DESCRIPTION : Return the square of a vector
INPUT : VectA : address of sl12_3D_tdstVector
OUTPUT : VectA.VectA : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xSqrVector( VectA) MTH3D_M_xSqrVector( VectA )
/* ##M==================================================================================
NAME : sl12_3D_M_xNormVector
DESCRIPTION : Return the norm of a vector
INPUT : VectA : address of sl12_3D_tdstVector
OUTPUT : ||VectA|| : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xNormVector( VectA ) MTH3D_M_xNormVector( VectA )
/* ##M==================================================================================
NAME : sl12_3D_M_xInvNormVector
DESCRIPTION : Return the inverse of the norm of a vector
INPUT : VectA : address of sl12_3D_tdstVector
OUTPUT : 1/||VectA|| : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xInvNormVector( VectA ) MTH3D_M_xInvNormVector( VectA )
/* ##M==================================================================================
NAME : sl12_3D_M_xVectorGapSqr
DESCRIPTION : Return the square Gap between two vectors
INPUT : VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : Sqr(||VectA-VectB||) : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xVectorGapSqr(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_xVectorGap
DESCRIPTION : Return the Gap between two vectors
INPUT : VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : ||VectA-VectB|| : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xVectorGap(VectA, VectB) MTH3D_M_xVectorGap(VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_vFillVector
DESCRIPTION : Fill each vector element with a value
INPUT : VectA: address of sl12_3D_tdstVector, a: SCA_td_sl12
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vFillVector( VectDest, a) MTH3D_M_vFillVector( VectDest, a)
/* ##M==================================================================================
NAME : sl12_3D_M_vNormalizeVector
DESCRIPTION : Normalize a vector : VectDest= VectA/||VectA||
INPUT : VectDest, VectA : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
/* Cf 3D_Conv.h */
/*#define sl12_3D_M_vNormalizeVector(VectDest, VectA) MTH3D_M_vNormalizeVector(VectDest, VectA)*/
/* ##M==================================================================================
NAME : sl12_3D_M_vGetVectorElements
DESCRIPTION : Get x, y, z values of a vector
INPUT : x, y, z : address of SCA_td_sl12, VectA : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vGetVectorElements( Vx, Vy, Vz, VectA) MTH3D_M_vGetVectorElements( Vx, Vy, Vz, VectA)
/* ##M==================================================================================
NAME : sl12_3D_M_vSetVectorElements
DESCRIPTION : Set a vector with x, y, z values
INPUT : VectDest : address of sl12_3D_tdstVector, x, y, z : address of SCA_td_sl12,
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz) MTH3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sl12_3D_M_xGetXofVector
DESCRIPTION : Return x element of a vector
INPUT : VectA : address of sl12_3D_tdstVector
OUTPUT : x : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xGetXofVector( VectA ) MTH3D_M_xGetXofVector( VectA )
/* ##M==================================================================================
NAME : sl12_3D_M_vSetXofVector
DESCRIPTION : Set x element of a vector
INPUT : VectDest : address of sl12_3D_tdstVector, Vx : SCA_td_sl12
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSetXofVector( VectDest, Vx) MTH3D_M_vSetXofVector( VectDest, Vx)
/* ##M==================================================================================
NAME : sl12_3D_M_xGetYofVector
DESCRIPTION : Return y element of a vector
INPUT : VectA : address of sl12_3D_tdstVector
OUTPUT : y : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xGetYofVector( VectA ) MTH3D_M_xGetYofVector( VectA )
/* ##M==================================================================================
NAME : sl12_3D_M_vSetYofVector
DESCRIPTION : Set y element of a vector
INPUT : VectDest : address of sl12_3D_tdstVector, Vy : SCA_td_sl12
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSetYofVector( VectDest, Vy) MTH3D_M_vSetYofVector( VectDest, Vy)
/* ##M==================================================================================
NAME : sl12_3D_M_xGetZofVector
DESCRIPTION : Return z element of a vector
INPUT : VectA : address of sl12_3D_tdstVector
OUTPUT : z : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xGetZofVector( VectA ) MTH3D_M_xGetZofVector( VectA )
/* ##M==================================================================================
NAME : sl12_3D_M_vSetZofVector
DESCRIPTION : Set z element of a vector
INPUT : VectDest : address of sl12_3D_tdstVector, Vz : SCA_td_sl12
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSetZofVector( VectDest, Vz) MTH3D_M_vSetZofVector( VectDest, Vz)
/* ##M==================================================================================
NAME : sl12_3D_M_vCopyVector
DESCRIPTION : Copy a vector : VectDest=VectA
INPUT : VectDest, VectA : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vCopyVector( VectDest, VectA) MTH3D_M_vCopyVector( VectDest, VectA)
/* ##M==================================================================================
NAME : sl12_3D_M_vNullVector
DESCRIPTION : Set all elements of a vector to zero
INPUT : VectDest : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vNullVector( VectDest) MTH3D_M_vNullVector( VectDest)
/* ##M==================================================================================
NAME : sl12_3D_M_vScaleVector
DESCRIPTION : Set each element of VectDest with the multiplication of element of VectA by element of VectB
INPUT : VectDest, VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vScaleVector( VectDest, VectA, VectB ) MTH3D_M_vScaleVector( VectDest, VectA, VectB )
/* ##M==================================================================================
NAME : sl12_3D_M_vMiddleVector
DESCRIPTION : Calculate the middle of two vectors : VectDest= (VectA+VectB)/2
INPUT : VectDest, VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vMiddleVector( VectDest, VectA, VectB ) MTH3D_M_vMiddleVector( VectDest, VectA, VectB )
/* ##M==================================================================================
NAME : sl12_3D_M_vLinearInterpolVector
DESCRIPTION : Calculate the lineat interpolation of two vectors : VectDest= VectA + t.(VectB-VectA)
INPUT : VectDest, VectA, VectB: address of sl12_3D_tdstVector, t: SCA_td_sl12
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t) MTH3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t)
/* ##M==================================================================================
NAME : sl12_3D_M_vMaxVector
DESCRIPTION : Make a vector with max elements of two other vectors
INPUT : VectDest, VectA, VectB: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vMaxVector( VectDest, VectA, VectB) MTH3D_M_vMaxVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_vMinVector
DESCRIPTION : Make a vector with min elements of two other vectors
INPUT : VectDest, VectA, VectB: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vMinVector( VectDest, VectA, VectB) MTH3D_M_vMinVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl12_3D_M_xDetxYVector
DESCRIPTION : Return the 2D determinant between X and Y elements
INPUT : VectA, VectB: address of sl12_3D_tdstVector
OUTPUT : DetxY |VectA, VectB| : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xDetxYVector( VectA, VectB ) MTH3D_M_xDetxYVector( VectA, VectB )
/* ##M==================================================================================
NAME : sl12_3D_M_xDetYZVector
DESCRIPTION : Return the 2D determinant between Y and Z elements
INPUT : VectA, VectB: address of sl12_3D_tdstVector
OUTPUT : DetYZ |VectA, VectB| : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xDetYZVector( VectA, VectB ) MTH3D_M_xDetYZVector( VectA, VectB )
/* ##M==================================================================================
NAME : sl12_3D_M_xDetZXVector
DESCRIPTION : Return the 2D determinant between Z and X elements
INPUT : VectA, VectB: address of sl12_3D_tdstVector
OUTPUT : DetZX |VectA, VectB| : SCA_td_sl12
=======================================================================================*/
#define sl12_3D_M_xDetZXVector( VectA, VectB ) MTH3D_M_xDetZXVector( VectA, VectB )
/* ##M==================================================================================
NAME : sl12_3D_M_bIsNullVector
DESCRIPTION : Test if a vector is null
INPUT : VectA : address of sl12_3D_tdstVector
OUTPUT : VectA==Null vector : Boolean
=======================================================================================*/
#define sl12_3D_M_bIsNullVector( VectA ) MTH3D_M_bIsNullVector( VectA )
/* ##M==================================================================================
NAME : sl12_3D_M_vMulAddVector
DESCRIPTION : Multiply a scalar to a vector, and add it to a other vector: VectDest = x.VectA + VectB
INPUT : VectDest: address of sl12_3D_tdstVector,
x: SCA_td_sl12, VectA, VectB : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vMulAddVector( VectDest, x, VectA, VectB) MTH3D_M_vMulAddVector( VectDest, x, VectA, VectB)
/* sl12_3D_M_vMullAddVector( VectDest, x, VectA, VectB) : VectDest = x.VectA + VectB */
#define sl12_3D_M_vMullAddVector sl12_3D_M_vMulAddVector
/* ##M==================================================================================
NAME : sl12_3D_M_vSetBaseIVector
DESCRIPTION : Set a vector to Ox base vector : VectDest = ( 1, 0, 0 )
INPUT : VectDest: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSetBaseIVector( VectDest ) MTH3D_M_vSetBaseIVector( VectDest )
/* ##M==================================================================================
NAME : sl12_3D_M_vSetBaseJVector
DESCRIPTION : Set a vector to Oy base vector : VectDest = ( 0, 1, 0 )
INPUT : VectDest: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSetBaseJVector( VectDest ) MTH3D_M_vSetBaseJVector( VectDest )
/* ##M==================================================================================
NAME : sl12_3D_M_vSetBaseKVector
DESCRIPTION : Set a vector to Oz base vector : VectDest = ( 0, 0, 1 )
INPUT : VectDest: address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl12_3D_M_vSetBaseKVector( VectDest ) MTH3D_M_vSetBaseKVector( VectDest )
/* ##M==================================================================================
NAME : sl12_3D_M_vPrintfVector
DESCRIPTION : Print a Vector : Name + its values
INPUT : Name : string
VectA : address of sl12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
__inline void Pf_sl12(td_sl12 _xValue)
{
printf( " %e",_xValue );
}
__inline void sl12_3D_fn_vPrintfVector( char * Name, sl12_3D_tdstVector * VectA)
{
MTH3D_M_vPrintfVector( Name, VectA );
}
#define sl12_3D_M_vPrintfVector( Name, VectA) sl12_3D_fn_vPrintfVector( Name, VectA)
#endif /* sl12_3D_H */

View File

@@ -0,0 +1,909 @@
/* ##H_FILE#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FILE : sl_3D.h
MODULE : sl (Common Mathematic Library)
DESCRIPTION : 3D Vectorial implementation
VERSION : sl V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
VERSION PC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* -----------------15/04/98 18:36-------------------
* Conversion : OK
* --------------------------------------------------*/
#ifndef _SCA_sl_3D_H_
#define _SCA_sl_3D_H_
#include "MTH\Specif\SCA\SCA_sl.h"
/* ##TYPEDEF#----------------------------------------------------------------------------
Types definition
---------------------------------------------------------------------------------------*/
/* 3D Vector : */
/*
#if 0
typedef VECTOR sl_3D_tdstVector;
#else
typedef struct sl_3D_tdstVector_
{
SCA_td_sl xX;
SCA_td_sl xY;
SCA_td_sl xZ;
SCA_td_sl pad;
} sl_3D_tdstVector;
#endif
*/
#define sl_3D_tdstVector MTH3D_tdstVector
/* 3D Matrix */
/*
typedef struct sl_3D_tdstMatrix_
{
sl_3D_tdstVector stCol_0;
sl_3D_tdstVector stCol_1;
sl_3D_tdstVector stCol_2;
} sl_3D_tdstMatrix;
*/
#define sl_3D_tdstMatrix MTH3D_tdstMatrix
/* ##MACRO#----------------------------------------------------------------------------
MACRO definition
---------------------------------------------------------------------------------------*/
/*+ ##-######################################
## MACRO AND FUNCTION FOR 3D MATHEMATICS
######################################### */
/* ##-###########################
## Vector Operations
############################## */
/* ##M==================================================================================
NAME : sl_3D_M_vAddVector
DESCRIPTION : Add two vectors : VectDest= VectA + VectB
INPUT : VectDest, VectA, VectB : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vAddVector( VectDest, VectA, VectB) MTH3D_M_vAddVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_vSubVector
DESCRIPTION : Sub two vectors : VectDest= VectA - VectB
INPUT : VectDest, VectA, VectB : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSubVector( VectDest, VectA, VectB) MTH3D_M_vSubVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_vNegVector
DESCRIPTION : Negation of a vector : VectDest= - VectA
INPUT : VectDest, VectA : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vNegVector( VectDest, VectA) MTH3D_M_vNegVector( VectDest, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_bEqualVector
DESCRIPTION : Test if two vectors are equal
INPUT : VectA, VectB : address of sl_3D_tdstVector
OUTPUT : VectA==VectB : Boolean
=======================================================================================*/
#define sl_3D_M_bEqualVector( VectA, VectB) MTH3D_M_bEqualVector( VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_vAddScalarVector
DESCRIPTION : Add a scalare with a vector : VectDest= a.Id + VectA
INPUT : VectDest: address of sl_3D_tdstVector,
a: SCA_td_sl, VectA: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vAddScalarVector( VectDest, a, VectA) MTH3D_M_vAddScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vSubScalarVector
DESCRIPTION : Add a scalare with a vector : VectDest= VectA - a.Id
INPUT : VectDest: address of sl_3D_tdstVector,
a: SCA_td_sl, VectA: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSubScalarVector( VectDest, a, VectA) MTH3D_M_vSubScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vMulScalarVector
DESCRIPTION : Multiplicate a scalare with a vector : VectDest= a*VectA
INPUT : VectDest: address of sl_3D_tdstVector,
a: SCA_td_sl, VectA: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulScalarVector( VectDest, a, VectA) MTH3D_M_vMulScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vDivScalarVector
DESCRIPTION : Divide a vector by a scalare : VectDest= VectA/a
INPUT : VectDest, VectA: address of sl_3D_tdstVector, a: SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vDivScalarVector( VectDest, VectA, a) MTH3D_M_vDivScalarVector( VectDest, VectA, a)
/* ##M==================================================================================
NAME : sl_3D_M_xDotProductVector
DESCRIPTION : Return the Dot Product of two vectors
INPUT : VectA, VectB : address of sl_3D_tdstVector
OUTPUT : VectA.VectB : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xDotProductVector( VectA, VectB) MTH3D_M_xDotProductVector( VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_vCrossProductVectorWithoutBuffer
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB,
VectDest must be a other vector
INPUT : VectDest, VectA, VectA: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_fn_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB) \
MTH3D_M_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB)
#define sl_3D_M_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB) \
sl_3D_fn_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_vCrossProductVector
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB
INPUT : VectDest, VectA, VectA: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vCrossProductVector(VectDest,VectA,VectB) MTH3D_M_vCrossProductVector(VectDest,VectA,VectB)
/* ##M==================================================================================
NAME : sl_3D_M_xSqrVector
DESCRIPTION : Return the square of a vector
INPUT : VectA : address of sl_3D_tdstVector
OUTPUT : VectA.VectA : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xSqrVector( VectA) MTH3D_M_xSqrVector( VectA )
/* ##M==================================================================================
NAME : sl_3D_M_xNormVector
DESCRIPTION : Return the norm of a vector
INPUT : VectA : address of sl_3D_tdstVector
OUTPUT : ||VectA|| : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xNormVector( VectA ) MTH3D_M_xNormVector( VectA )
/* ##M==================================================================================
NAME : sl_3D_M_xInvNormVector
DESCRIPTION : Return the inverse of the norm of a vector
INPUT : VectA : address of sl_3D_tdstVector
OUTPUT : 1/||VectA|| : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xInvNormVector( VectA ) MTH3D_M_xInvNormVector( VectA )
/* ##M==================================================================================
NAME : sl_3D_M_xVectorGapSqr
DESCRIPTION : Return the square Gap between two vectors
INPUT : VectA, VectB : address of sl_3D_tdstVector
OUTPUT : Sqr(||VectA-VectB||) : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xVectorGapSqr(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_xVectorGap
DESCRIPTION : Return the Gap between two vectors
INPUT : VectA, VectB : address of sl_3D_tdstVector
OUTPUT : ||VectA-VectB|| : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xVectorGap(VectA, VectB) MTH3D_M_xVectorGap(VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_vFillVector
DESCRIPTION : Fill each vector element with a value
INPUT : VectA: address of sl_3D_tdstVector, a: SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vFillVector( VectDest, a) MTH3D_M_vFillVector( VectDest, a)
/* ##M==================================================================================
NAME : sl_3D_M_vNormalizeVector
DESCRIPTION : Normalize a vector : VectDest= VectA/||VectA||
INPUT : VectDest, VectA : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vNormalizeVector(VectDest, VectA) MTH3D_M_vNormalizeVector(VectDest, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetVectorElements
DESCRIPTION : Get x, y, z values of a vector
INPUT : x, y, z : address of SCA_td_sl, VectA : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetVectorElements( Vx, Vy, Vz, VectA) MTH3D_M_vGetVectorElements( Vx, Vy, Vz, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vSetVectorElements
DESCRIPTION : Set a vector with x, y, z values
INPUT : VectDest : address of sl_3D_tdstVector, x, y, z : address of SCA_td_sl,
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz) MTH3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sl_3D_M_xGetXofVector
DESCRIPTION : Return x element of a vector
INPUT : VectA : address of sl_3D_tdstVector
OUTPUT : x : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xGetXofVector( VectA ) MTH3D_M_xGetXofVector( VectA )
/* ##M==================================================================================
NAME : sl_3D_M_vSetXofVector
DESCRIPTION : Set x element of a vector
INPUT : VectDest : address of sl_3D_tdstVector, Vx : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetXofVector( VectDest, Vx) MTH3D_M_vSetXofVector( VectDest, Vx)
/* ##M==================================================================================
NAME : sl_3D_M_xGetYofVector
DESCRIPTION : Return y element of a vector
INPUT : VectA : address of sl_3D_tdstVector
OUTPUT : y : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xGetYofVector( VectA ) MTH3D_M_xGetYofVector( VectA )
/* ##M==================================================================================
NAME : sl_3D_M_vSetYofVector
DESCRIPTION : Set y element of a vector
INPUT : VectDest : address of sl_3D_tdstVector, Vy : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetYofVector( VectDest, Vy) MTH3D_M_vSetYofVector( VectDest, Vy)
/* ##M==================================================================================
NAME : sl_3D_M_xGetZofVector
DESCRIPTION : Return z element of a vector
INPUT : VectA : address of sl_3D_tdstVector
OUTPUT : z : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xGetZofVector( VectA ) MTH3D_M_xGetZofVector( VectA )
/* ##M==================================================================================
NAME : sl_3D_M_vSetZofVector
DESCRIPTION : Set z element of a vector
INPUT : VectDest : address of sl_3D_tdstVector, Vz : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetZofVector( VectDest, Vz) MTH3D_M_vSetZofVector( VectDest, Vz)
/* ##M==================================================================================
NAME : sl_3D_M_vCopyVector
DESCRIPTION : Copy a vector : VectDest=VectA
INPUT : VectDest, VectA : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vCopyVector( VectDest, VectA) MTH3D_M_vCopyVector( VectDest, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vNullVector
DESCRIPTION : Set all elements of a vector to zero
INPUT : VectDest : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vNullVector( VectDest) MTH3D_M_vNullVector( VectDest)
/* ##M==================================================================================
NAME : sl_3D_M_vScaleVector
DESCRIPTION : Set each element of VectDest with the multiplication of element of VectA by element of VectB
INPUT : VectDest, VectA, VectB : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vScaleVector( VectDest, VectA, VectB ) MTH3D_M_vScaleVector( VectDest, VectA, VectB )
/* ##M==================================================================================
NAME : sl_3D_M_vMiddleVector
DESCRIPTION : Calculate the middle of two vectors : VectDest= (VectA+VectB)/2
INPUT : VectDest, VectA, VectB : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMiddleVector( VectDest, VectA, VectB ) MTH3D_M_vMiddleVector( VectDest, VectA, VectB )
/* ##M==================================================================================
NAME : sl_3D_M_vLinearInterpolVector
DESCRIPTION : Calculate the lineat interpolation of two vectors : VectDest= VectA + t.(VectB-VectA)
INPUT : VectDest, VectA, VectB: address of sl_3D_tdstVector, t: SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t) MTH3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t)
/* ##M==================================================================================
NAME : sl_3D_M_vMaxVector
DESCRIPTION : Make a vector with max elements of two other vectors
INPUT : VectDest, VectA, VectB: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMaxVector( VectDest, VectA, VectB) MTH3D_M_vMaxVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_vMinVector
DESCRIPTION : Make a vector with min elements of two other vectors
INPUT : VectDest, VectA, VectB: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMinVector( VectDest, VectA, VectB) MTH3D_M_vMinVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sl_3D_M_xDetxYVector
DESCRIPTION : Return the 2D determinant between X and Y elements
INPUT : VectA, VectB: address of sl_3D_tdstVector
OUTPUT : DetxY |VectA, VectB| : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xDetxYVector( VectA, VectB ) MTH3D_M_xDetxYVector( VectA, VectB )
/* ##M==================================================================================
NAME : sl_3D_M_xDetYZVector
DESCRIPTION : Return the 2D determinant between Y and Z elements
INPUT : VectA, VectB: address of sl_3D_tdstVector
OUTPUT : DetYZ |VectA, VectB| : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xDetYZVector( VectA, VectB ) MTH3D_M_xDetYZVector( VectA, VectB )
/* ##M==================================================================================
NAME : sl_3D_M_xDetZXVector
DESCRIPTION : Return the 2D determinant between Z and X elements
INPUT : VectA, VectB: address of sl_3D_tdstVector
OUTPUT : DetZX |VectA, VectB| : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xDetZXVector( VectA, VectB ) MTH3D_M_xDetZXVector( VectA, VectB )
/* ##M==================================================================================
NAME : sl_3D_M_bIsNullVector
DESCRIPTION : Test if a vector is null
INPUT : VectA : address of sl_3D_tdstVector
OUTPUT : VectA==Null vector : Boolean
=======================================================================================*/
#define sl_3D_M_bIsNullVector( VectA ) MTH3D_M_bIsNullVector( VectA )
/* ##M==================================================================================
NAME : sl_3D_M_vMulAddVector
DESCRIPTION : Multiply a scalar to a vector, and add it to a other vector: VectDest = x.VectA + VectB
INPUT : VectDest: address of sl_3D_tdstVector,
x: SCA_td_sl, VectA, VectB : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulAddVector( VectDest, x, VectA, VectB) MTH3D_M_vMulAddVector( VectDest, x, VectA, VectB)
/* sl_3D_M_vMullAddVector( VectDest, x, VectA, VectB) : VectDest = x.VectA + VectB */
#define sl_3D_M_vMullAddVector sl_3D_M_vMulAddVector
/* ##M==================================================================================
NAME : sl_3D_M_vSetBaseIVector
DESCRIPTION : Set a vector to Ox base vector : VectDest = ( 1, 0, 0 )
INPUT : VectDest: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetBaseIVector( VectDest ) MTH3D_M_vSetBaseIVector( VectDest )
/* ##M==================================================================================
NAME : sl_3D_M_vSetBaseJVector
DESCRIPTION : Set a vector to Oy base vector : VectDest = ( 0, 1, 0 )
INPUT : VectDest: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetBaseJVector( VectDest ) MTH3D_M_vSetBaseJVector( VectDest )
/* ##M==================================================================================
NAME : sl_3D_M_vSetBaseKVector
DESCRIPTION : Set a vector to Oz base vector : VectDest = ( 0, 0, 1 )
INPUT : VectDest: address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetBaseKVector( VectDest ) MTH3D_M_vSetBaseKVector( VectDest )
/* ##-###########################
## Matrix operations
############################## */
/* ##M==================================================================================
NAME : sl_3D_M_vCopyMatrix
DESCRIPTION : Copy MatA in MatDest
INPUT : MatDest, MatA: address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vCopyMatrix( MatDest, MatA) MTH3D_M_vCopyMatrix( MatDest, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vAddMatrix
DESCRIPTION : Add two matrix : MatDest= MatA + MatB
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vAddMatrix( MatDest, MatA, MatB) MTH3D_M_vAddMatrix( MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sl_3D_M_vSubMatrix
DESCRIPTION : Sub two matrix : MatDest= MatA - MatB
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSubMatrix( MatDest, MatA, MatB) MTH3D_M_vSubMatrix( MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sl_3D_M_vNegMatrix
DESCRIPTION : Make the Nagation of a matrix : MatDest= -MatA
INPUT : MatDest, MatA: address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vNegMatrix( MatDest, MatA) MTH3D_M_vNegMatrix( MatDest, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vMulMatrixMatrixWithoutBuffer
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB, MatDest must be a other matrix
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
MTH3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sl_3D_M_vMulMatrixMatrix
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
MTH3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
/* ##M==================================================================================
NAME : sl_3D_M_vMulTranspMatrixMatrixWithoutBuffer
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
MatDest must be a other matrix
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
MTH3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sl_3D_M_vMulTranspMatrixMatrix
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
MTH3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
/* ##M==================================================================================
NAME : sl_3D_M_vMulScalarMatrix
DESCRIPTION : Multiply a scalar with a matrix : MatDest= a*MatA
INPUT : MatDest : address of sl_3D_tdstMatrix
a: SCA_td_sl, MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulScalarMatrix(MatDest, a, MatA) \
MTH3D_M_vMulScalarMatrix(MatDest, a, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vDivScalarMatrix
DESCRIPTION : Divide a matrix by a scalar : MatDest= MatA/a
INPUT : MatDest : address of sl_3D_tdstMatrix
MatA : address of sl_3D_tdstMatrix, a: SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vDivScalarMatrix(MatDest, MatA, a) \
MTH3D_M_vDivScalarMatrix(MatDest, MatA, a)
/* ##M==================================================================================
NAME : sl_3D_M_vSqrMatrix
DESCRIPTION : Square a matrix : MatDest= MatA*MatA
INPUT : MatDest : address of sl_3D_tdstMatrix
MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSqrMatrix(MatDest, MatA) MTH3D_M_vSqrMatrix(MatDest, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vTranspMatrixWithoutBuffer
DESCRIPTION : Transpose a matrix : MatDest= transp MatA, Matdest must be a other matrix
INPUT : MatDest : address of sl_3D_tdstMatrix
MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA) \
MTH3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA)
/* sl_3D_M_vTranpMatrixWithoutBuffer(MatDest, MatA) : MatDest= transp MatA */
#define sl_3D_M_vTranpMatrixWithoutBuffer sl_3D_M_vTranspMatrixWithoutBuffer
/* ##M==================================================================================
NAME : sl_3D_M_vTranspMatrix
DESCRIPTION : Transpose a matrix : MatDest= transp MatA
INPUT : MatDest : address of sl_3D_tdstMatrix
MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vTranspMatrix(Mat_Dest, Mat_A) MTH3D_M_vTranspMatrix(Mat_Dest, Mat_A)
/* sl_3D_M_vTranpMatrix(MatDest, MatA) : MatDest= transp MatA */
#define sl_3D_M_vTranpMatrix sl_3D_M_vTranspMatrix
/* ##M==================================================================================
NAME : sl_3D_M_xTraceMatrix
DESCRIPTION : Return the trace of a matrix
INPUT : MatA : address of sl_3D_tdstMatrix
OUTPUT : trace MatA : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xTraceMatrix(MatA) MTH3D_M_xTraceMatrix(MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vSetIdentityMatrix
DESCRIPTION : Set a matrix to the Identity matrix : MatDest= Id
INPUT : MatDest : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetIdentityMatrix(MatDest) MTH3D_M_vSetIdentityMatrix(MatDest)
/* ##M==================================================================================
NAME : sl_3D_M_bEqualMatrix
DESCRIPTION : Test if two matrix are equal
INPUT : MatA, MatB : address of sl_3D_tdstMatrix
OUTPUT : MatA==MatB : Boolean
=======================================================================================*/
#define sl_3D_M_bEqualMatrix(MatA, MatB) MTH3D_M_bEqualMatrix(MatA, MatB)
/* ##M==================================================================================
NAME : sl_3D_M_bMatchMatrix
DESCRIPTION : Test if two matrix are neary equal
INPUT : MatA, MatB : address of sl_3D_tdstMatrix
eps : SCA_td_sl
OUTPUT : (MatA match MatB to within about eps) : Boolean
=======================================================================================*/
#define sl_3D_M_bMatchMatrix(MatA, MatB, eps) MTH3D_M_bMatchMatrix(MatA, MatB, eps)
/* ##M==================================================================================
NAME : sl_3D_M_vFillMatrix
DESCRIPTION : Fill each matrix element with "a" value
INPUT : MatDest : address of sl_3D_tdstMatrix
a : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vFillMatrix(MatDest, a) MTH3D_M_vFillMatrix(MatDest, a)
/* ##M==================================================================================
NAME : sl_3D_M_xDetMatrix
DESCRIPTION : Return the determinant of a matrix
INPUT : MatA : address of sl_3D_tdstMatrix
OUTPUT : det MatA : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xDetMatrix(MatA) MTH3D_M_xDetMatrix(MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vComMatrixWithoutBuffer
DESCRIPTION : Calculate the Cofactor Matrix of a matrix : MatDest= Cofactor Matrix of MatA
INPUT : Matdest, MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
MTH3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
/* ##M==================================================================================
NAME : sl_3D_M_vInverMatrix
DESCRIPTION : Invert a matrix : MatDest= Inv MatA
INPUT : Matdest, MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vInverMatrix(MatDest, MatA) MTH3D_M_vInverMatrix(MatDest, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetMatrixColumnElements
DESCRIPTION : Get x, y, z column col values in MatA
INPUT : x, y, z : SCA_td_sl
col : int
MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA) \
MTH3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vSetMatrixColumnElements
DESCRIPTION : Set column col x, y, z values in MatDest
INPUT : MatDest : address of sl_3D_tdstMatrix
x, y, z : SCA_td_sl
col : int
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col) \
MTH3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col)
/* ##M==================================================================================
NAME : sl_3D_M_xGetMatrixElement
DESCRIPTION : Return element at (lin, col) in MatASet
INPUT : MatA : address of sl_3D_tdstMatrix
lin, col : int
OUTPUT : a : SCA_td_sl
=======================================================================================*/
#define sl_3D_M_xGetMatrixElement( lin, col, MatA) MTH3D_M_xGetMatrixElement( lin, col, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vSetMatrixElement
DESCRIPTION : Set a element in MatDest at (lin, col)
INPUT : MatDest : address of sl_3D_tdstMatrix
a : SCA_td_sl
lin, col : int
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetMatrixElement( MatDest, a, lin, col) MTH3D_M_vSetMatrixElement( MatDest, a, lin, col)
/* ##M==================================================================================
NAME : sl_3D_M_vSetMatrixCol0Elements
DESCRIPTION : Set x, y, z values of column 0 in MatDest
INPUT : MatDest : address of sl_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sl_3D_M_vSetMatrixCol1Elements
DESCRIPTION : Set x, y, z values of column 1 in MatDest
INPUT : MatDest : address of sl_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sl_3D_M_vSetMatrixCol2Elements
DESCRIPTION : Set x, y, z values of column 2 in MatDest
INPUT : MatDest : address of sl_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sl_3D_M_vSetMatrixLineXElements
DESCRIPTION : Set x elements of all columns in MatDest
INPUT : MatDest : address of sl_3D_tdstMatrix
V0, V0, V0 : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sl_3D_M_vSetMatrixLineYElements
DESCRIPTION : Set y elements of all columns in MatDest
INPUT : MatDest : address of sl_3D_tdstMatrix
V0, V0, V0 : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sl_3D_M_vSetMatrixLineZElements
DESCRIPTION : Set z elements of all columns in MatDest
INPUT : MatDest : address of sl_3D_tdstMatrix
V0, V0, V0 : SCA_td_sl
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sl_3D_M_vGetMatrixCol0Elements
DESCRIPTION : Get x, y, z values of column 0 in MatA
Vx, Vy, Vz : SCA_td_sl
INPUT : MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetMatrixCol1Elements
DESCRIPTION : Get x, y, z values of column 1 in MatA
Vx, Vy, Vz : SCA_td_sl
INPUT : MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetMatrixCol2Elements
DESCRIPTION : Get x, y, z values of column 2 in MatA
Vx, Vy, Vz : SCA_td_sl
INPUT : MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetMatrixLineXElements
DESCRIPTION : Get x elements of all columns in MatA
V0, V0, V0 : SCA_td_sl
INPUT : MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetMatrixLineYElements
DESCRIPTION : Get y elements of all columns in MatA
V0, V0, V0 : SCA_td_sl
INPUT : MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetMatrixLineZElements
DESCRIPTION : Get z elements of all columns in MatA
V0, V0, V0 : SCA_td_sl
INPUT : MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA)
/* ##-###########################
## Matrix-Vector operations
############################## */
/* ##M==================================================================================
NAME : sl_3D_M_vMulMatrixVectorWithoutBuffer
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA, VectDest must be
a other vector
INPUT : VectDest : address of sl_3D_tdstVector
MatA : address of sl_3D_tdstMatrix
VectA : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA) \
MTH3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vMulMatrixVector
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA
INPUT : VectDest : address of sl_3D_tdstVector
MatA : address of sl_3D_tdstMatrix
VectA : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vMulMatrixVector( VectDest, MatA, VectA) \
MTH3D_M_vMulMatrixVector( VectDest, MatA, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetColumnInMatrix
DESCRIPTION : Get a Vector column of a Matrix to a Vector : VectDest= columm col of MatA
INPUT : VectDest : address of sl_3D_tdstVector
MatA : address of sl_3D_tdstMatrix
col : int
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetColumnInMatrix( VectDest, MatA, col ) \
MTH3D_M_vGetColumnInMatrix( VectDest, MatA, col )
/* ##M==================================================================================
NAME : sl_3D_M_vSetColumnInMatrix
DESCRIPTION : Put a Vector to a column of a Matrix : Set columm col of MatDest with VectA
INPUT : MatDest : address of sl_3D_tdstMatrix
VectA : address of sl_3D_tdstVector
col : int
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetColumnInMatrix( MatDest, VectA, col) \
MTH3D_M_vSetColumnInMatrix( MatDest, VectA, col)
/* ##M==================================================================================
NAME : sl_3D_M_vGetLineInMatrix
DESCRIPTION : Get a Vector line of a Matrix to a Vector : VectDest= line lin of MatA
INPUT : VectDest : address of sl_3D_tdstVector
MatA : address of sl_3D_tdstMatrix
lin : int
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetLineInMatrix( VectDest, MatA, lin ) \
MTH3D_M_vGetLineInMatrix( VectDest, MatA, lin )
/* ##M==================================================================================
NAME : sl_3D_M_vSetLineInMatrix
DESCRIPTION : Put a Vector to a line of a Matrix : Set line lin of MatDest with VectA
INPUT : MatDest : address of sl_3D_tdstMatrix
VectA : address of sl_3D_tdstVector
lin : int
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetLineInMatrix( MatDest, VectA, lin) \
MTH3D_M_vSetLineInMatrix( MatDest, VectA, lin)
/* ##M==================================================================================
NAME : sl_3D_M_vGetDiagInMatrix
DESCRIPTION : Get a Vector diagonal of a Matrix to a Vector : VectDest= diagonal of MatA
INPUT : VectDest : address of sl_3D_tdstVector
MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetDiagInMatrix( VectDest, MatA) \
MTH3D_M_vGetDiagInMatrix( VectDest, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vSetDiagInMatrix
DESCRIPTION : Put a Vector to a diagonal of a Matrix : Set diagonal of MatDest with VectA
INPUT : MatDest : address of sl_3D_tdstMatrix
VectA : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetDiagInMatrix( MatDest, VectA) \
MTH3D_M_vSetDiagInMatrix( MatDest, VectA)
/* ##M==================================================================================
NAME : sl_3D_M_vGetVectorsInMatrix
DESCRIPTION : Get all column Matrix to two Vectors
INPUT : VaDest, VbDest, VcDest: address of sl_3D_tdstVector
MatA : address of sl_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA) \
MTH3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA)
/* ##M==================================================================================
NAME : sl_3D_M_vSetVectorsInMatrix
DESCRIPTION : Set all column Matrix with two Vectors
INPUT : MatDest : address of sl_3D_tdstMatrix
VectA, VectB, VectC : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sl_3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC) \
MTH3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC)
/* ##M==================================================================================
NAME : sl_3D_M_vPrintfVector
DESCRIPTION : Print a Vector : Name + its values
INPUT : Name : string
VectA : address of sl_3D_tdstVector
OUTPUT : void
=======================================================================================*/
__inline void Pf_sl(td_sl _xValue)
{
printf( " %e",_xValue );
}
__inline void sl_3D_fn_vPrintfVector( char * Name, sl_3D_tdstVector * VectA)
{
MTH3D_M_vPrintfVector( Name, VectA );
}
#define sl_3D_M_vPrintfVector( Name, VectA) sl_3D_fn_vPrintfVector( Name, VectA)
#endif /* sl_3D_H */

View File

@@ -0,0 +1,909 @@
/* ##H_FILE#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FILE : sw12_3D.h
MODULE : sw12 (Common Mathematic Library)
DESCRIPTION : 3D Vectorial implementation
VERSION : sw12 V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
VERSION PC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* -----------------15/04/98 18:36-------------------
* Conversion : OK
* --------------------------------------------------*/
#ifndef _SCA_sw12_3D_H_
#define _SCA_sw12_3D_H_
#include "MTH\Specif\SCA\SCA_sw12.h"
/* ##TYPEDEF#----------------------------------------------------------------------------
Types definition
---------------------------------------------------------------------------------------*/
/* 3D Vector : */
/*
#if 0
typedef VECTOR sw12_3D_tdstVector;
#else
typedef struct sw12_3D_tdstVector_
{
SCA_td_sw12 xX;
SCA_td_sw12 xY;
SCA_td_sw12 xZ;
SCA_td_sw12 pad;
} sw12_3D_tdstVector;
#endif
*/
#define sw12_3D_tdstVector MTH3D_tdstVector
/* 3D Matrix */
/*
typedef struct sw12_3D_tdstMatrix_
{
sw12_3D_tdstVector stCol_0;
sw12_3D_tdstVector stCol_1;
sw12_3D_tdstVector stCol_2;
} sw12_3D_tdstMatrix;
*/
#define sw12_3D_tdstMatrix MTH3D_tdstMatrix
/* ##MACRO#----------------------------------------------------------------------------
MACRO definition
---------------------------------------------------------------------------------------*/
/*+ ##-######################################
## MACRO AND FUNCTION FOR 3D MATHEMATICS
######################################### */
/* ##-###########################
## Vector Operations
############################## */
/* ##M==================================================================================
NAME : sw12_3D_M_vAddVector
DESCRIPTION : Add two vectors : VectDest= VectA + VectB
INPUT : VectDest, VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vAddVector( VectDest, VectA, VectB) MTH3D_M_vAddVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_vSubVector
DESCRIPTION : Sub two vectors : VectDest= VectA - VectB
INPUT : VectDest, VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSubVector( VectDest, VectA, VectB) MTH3D_M_vSubVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_vNegVector
DESCRIPTION : Negation of a vector : VectDest= - VectA
INPUT : VectDest, VectA : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vNegVector( VectDest, VectA) MTH3D_M_vNegVector( VectDest, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_bEqualVector
DESCRIPTION : Test if two vectors are equal
INPUT : VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : VectA==VectB : Boolean
=======================================================================================*/
#define sw12_3D_M_bEqualVector( VectA, VectB) MTH3D_M_bEqualVector( VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_vAddScalarVector
DESCRIPTION : Add a scalare with a vector : VectDest= a.Id + VectA
INPUT : VectDest: address of sw12_3D_tdstVector,
a: SCA_td_sw12, VectA: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vAddScalarVector( VectDest, a, VectA) MTH3D_M_vAddScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vSubScalarVector
DESCRIPTION : Add a scalare with a vector : VectDest= VectA - a.Id
INPUT : VectDest: address of sw12_3D_tdstVector,
a: SCA_td_sw12, VectA: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSubScalarVector( VectDest, a, VectA) MTH3D_M_vSubScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vMulScalarVector
DESCRIPTION : Multiplicate a scalare with a vector : VectDest= a*VectA
INPUT : VectDest: address of sw12_3D_tdstVector,
a: SCA_td_sw12, VectA: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulScalarVector( VectDest, a, VectA) MTH3D_M_vMulScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vDivScalarVector
DESCRIPTION : Divide a vector by a scalare : VectDest= VectA/a
INPUT : VectDest, VectA: address of sw12_3D_tdstVector, a: SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vDivScalarVector( VectDest, VectA, a) MTH3D_M_vDivScalarVector( VectDest, VectA, a)
/* ##M==================================================================================
NAME : sw12_3D_M_xDotProductVector
DESCRIPTION : Return the Dot Product of two vectors
INPUT : VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : VectA.VectB : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xDotProductVector( VectA, VectB) MTH3D_M_xDotProductVector( VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_vCrossProductVectorWithoutBuffer
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB,
VectDest must be a other vector
INPUT : VectDest, VectA, VectA: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_fn_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB) \
MTH3D_M_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB)
#define sw12_3D_M_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB) \
sw12_3D_fn_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_vCrossProductVector
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB
INPUT : VectDest, VectA, VectA: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vCrossProductVector(VectDest,VectA,VectB) MTH3D_M_vCrossProductVector(VectDest,VectA,VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_xSqrVector
DESCRIPTION : Return the square of a vector
INPUT : VectA : address of sw12_3D_tdstVector
OUTPUT : VectA.VectA : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xSqrVector( VectA) MTH3D_M_xSqrVector( VectA )
/* ##M==================================================================================
NAME : sw12_3D_M_xNormVector
DESCRIPTION : Return the norm of a vector
INPUT : VectA : address of sw12_3D_tdstVector
OUTPUT : ||VectA|| : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xNormVector( VectA ) MTH3D_M_xNormVector( VectA )
/* ##M==================================================================================
NAME : sw12_3D_M_xInvNormVector
DESCRIPTION : Return the inverse of the norm of a vector
INPUT : VectA : address of sw12_3D_tdstVector
OUTPUT : 1/||VectA|| : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xInvNormVector( VectA ) MTH3D_M_xInvNormVector( VectA )
/* ##M==================================================================================
NAME : sw12_3D_M_xVectorGapSqr
DESCRIPTION : Return the square Gap between two vectors
INPUT : VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : Sqr(||VectA-VectB||) : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xVectorGapSqr(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_xVectorGap
DESCRIPTION : Return the Gap between two vectors
INPUT : VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : ||VectA-VectB|| : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xVectorGap(VectA, VectB) MTH3D_M_xVectorGap(VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_vFillVector
DESCRIPTION : Fill each vector element with a value
INPUT : VectA: address of sw12_3D_tdstVector, a: SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vFillVector( VectDest, a) MTH3D_M_vFillVector( VectDest, a)
/* ##M==================================================================================
NAME : sw12_3D_M_vNormalizeVector
DESCRIPTION : Normalize a vector : VectDest= VectA/||VectA||
INPUT : VectDest, VectA : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vNormalizeVector(VectDest, VectA) MTH3D_M_vNormalizeVector(VectDest, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetVectorElements
DESCRIPTION : Get x, y, z values of a vector
INPUT : x, y, z : address of SCA_td_sw12, VectA : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetVectorElements( Vx, Vy, Vz, VectA) MTH3D_M_vGetVectorElements( Vx, Vy, Vz, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetVectorElements
DESCRIPTION : Set a vector with x, y, z values
INPUT : VectDest : address of sw12_3D_tdstVector, x, y, z : address of SCA_td_sw12,
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz) MTH3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sw12_3D_M_xGetXofVector
DESCRIPTION : Return x element of a vector
INPUT : VectA : address of sw12_3D_tdstVector
OUTPUT : x : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xGetXofVector( VectA ) MTH3D_M_xGetXofVector( VectA )
/* ##M==================================================================================
NAME : sw12_3D_M_vSetXofVector
DESCRIPTION : Set x element of a vector
INPUT : VectDest : address of sw12_3D_tdstVector, Vx : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetXofVector( VectDest, Vx) MTH3D_M_vSetXofVector( VectDest, Vx)
/* ##M==================================================================================
NAME : sw12_3D_M_xGetYofVector
DESCRIPTION : Return y element of a vector
INPUT : VectA : address of sw12_3D_tdstVector
OUTPUT : y : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xGetYofVector( VectA ) MTH3D_M_xGetYofVector( VectA )
/* ##M==================================================================================
NAME : sw12_3D_M_vSetYofVector
DESCRIPTION : Set y element of a vector
INPUT : VectDest : address of sw12_3D_tdstVector, Vy : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetYofVector( VectDest, Vy) MTH3D_M_vSetYofVector( VectDest, Vy)
/* ##M==================================================================================
NAME : sw12_3D_M_xGetZofVector
DESCRIPTION : Return z element of a vector
INPUT : VectA : address of sw12_3D_tdstVector
OUTPUT : z : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xGetZofVector( VectA ) MTH3D_M_xGetZofVector( VectA )
/* ##M==================================================================================
NAME : sw12_3D_M_vSetZofVector
DESCRIPTION : Set z element of a vector
INPUT : VectDest : address of sw12_3D_tdstVector, Vz : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetZofVector( VectDest, Vz) MTH3D_M_vSetZofVector( VectDest, Vz)
/* ##M==================================================================================
NAME : sw12_3D_M_vCopyVector
DESCRIPTION : Copy a vector : VectDest=VectA
INPUT : VectDest, VectA : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vCopyVector( VectDest, VectA) MTH3D_M_vCopyVector( VectDest, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vNullVector
DESCRIPTION : Set all elements of a vector to zero
INPUT : VectDest : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vNullVector( VectDest) MTH3D_M_vNullVector( VectDest)
/* ##M==================================================================================
NAME : sw12_3D_M_vScaleVector
DESCRIPTION : Set each element of VectDest with the multiplication of element of VectA by element of VectB
INPUT : VectDest, VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vScaleVector( VectDest, VectA, VectB ) MTH3D_M_vScaleVector( VectDest, VectA, VectB )
/* ##M==================================================================================
NAME : sw12_3D_M_vMiddleVector
DESCRIPTION : Calculate the middle of two vectors : VectDest= (VectA+VectB)/2
INPUT : VectDest, VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMiddleVector( VectDest, VectA, VectB ) MTH3D_M_vMiddleVector( VectDest, VectA, VectB )
/* ##M==================================================================================
NAME : sw12_3D_M_vLinearInterpolVector
DESCRIPTION : Calculate the lineat interpolation of two vectors : VectDest= VectA + t.(VectB-VectA)
INPUT : VectDest, VectA, VectB: address of sw12_3D_tdstVector, t: SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t) MTH3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t)
/* ##M==================================================================================
NAME : sw12_3D_M_vMaxVector
DESCRIPTION : Make a vector with max elements of two other vectors
INPUT : VectDest, VectA, VectB: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMaxVector( VectDest, VectA, VectB) MTH3D_M_vMaxVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_vMinVector
DESCRIPTION : Make a vector with min elements of two other vectors
INPUT : VectDest, VectA, VectB: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMinVector( VectDest, VectA, VectB) MTH3D_M_vMinVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw12_3D_M_xDetxYVector
DESCRIPTION : Return the 2D determinant between X and Y elements
INPUT : VectA, VectB: address of sw12_3D_tdstVector
OUTPUT : DetxY |VectA, VectB| : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xDetxYVector( VectA, VectB ) MTH3D_M_xDetxYVector( VectA, VectB )
/* ##M==================================================================================
NAME : sw12_3D_M_xDetYZVector
DESCRIPTION : Return the 2D determinant between Y and Z elements
INPUT : VectA, VectB: address of sw12_3D_tdstVector
OUTPUT : DetYZ |VectA, VectB| : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xDetYZVector( VectA, VectB ) MTH3D_M_xDetYZVector( VectA, VectB )
/* ##M==================================================================================
NAME : sw12_3D_M_xDetZXVector
DESCRIPTION : Return the 2D determinant between Z and X elements
INPUT : VectA, VectB: address of sw12_3D_tdstVector
OUTPUT : DetZX |VectA, VectB| : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xDetZXVector( VectA, VectB ) MTH3D_M_xDetZXVector( VectA, VectB )
/* ##M==================================================================================
NAME : sw12_3D_M_bIsNullVector
DESCRIPTION : Test if a vector is null
INPUT : VectA : address of sw12_3D_tdstVector
OUTPUT : VectA==Null vector : Boolean
=======================================================================================*/
#define sw12_3D_M_bIsNullVector( VectA ) MTH3D_M_bIsNullVector( VectA )
/* ##M==================================================================================
NAME : sw12_3D_M_vMulAddVector
DESCRIPTION : Multiply a scalar to a vector, and add it to a other vector: VectDest = x.VectA + VectB
INPUT : VectDest: address of sw12_3D_tdstVector,
x: SCA_td_sw12, VectA, VectB : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulAddVector( VectDest, x, VectA, VectB) MTH3D_M_vMulAddVector( VectDest, x, VectA, VectB)
/* sw12_3D_M_vMullAddVector( VectDest, x, VectA, VectB) : VectDest = x.VectA + VectB */
#define sw12_3D_M_vMullAddVector sw12_3D_M_vMulAddVector
/* ##M==================================================================================
NAME : sw12_3D_M_vSetBaseIVector
DESCRIPTION : Set a vector to Ox base vector : VectDest = ( 1, 0, 0 )
INPUT : VectDest: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetBaseIVector( VectDest ) MTH3D_M_vSetBaseIVector( VectDest )
/* ##M==================================================================================
NAME : sw12_3D_M_vSetBaseJVector
DESCRIPTION : Set a vector to Oy base vector : VectDest = ( 0, 1, 0 )
INPUT : VectDest: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetBaseJVector( VectDest ) MTH3D_M_vSetBaseJVector( VectDest )
/* ##M==================================================================================
NAME : sw12_3D_M_vSetBaseKVector
DESCRIPTION : Set a vector to Oz base vector : VectDest = ( 0, 0, 1 )
INPUT : VectDest: address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetBaseKVector( VectDest ) MTH3D_M_vSetBaseKVector( VectDest )
/* ##-###########################
## Matrix operations
############################## */
/* ##M==================================================================================
NAME : sw12_3D_M_vCopyMatrix
DESCRIPTION : Copy MatA in MatDest
INPUT : MatDest, MatA: address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vCopyMatrix( MatDest, MatA) MTH3D_M_vCopyMatrix( MatDest, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vAddMatrix
DESCRIPTION : Add two matrix : MatDest= MatA + MatB
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vAddMatrix( MatDest, MatA, MatB) MTH3D_M_vAddMatrix( MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sw12_3D_M_vSubMatrix
DESCRIPTION : Sub two matrix : MatDest= MatA - MatB
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSubMatrix( MatDest, MatA, MatB) MTH3D_M_vSubMatrix( MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sw12_3D_M_vNegMatrix
DESCRIPTION : Make the Nagation of a matrix : MatDest= -MatA
INPUT : MatDest, MatA: address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vNegMatrix( MatDest, MatA) MTH3D_M_vNegMatrix( MatDest, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vMulMatrixMatrixWithoutBuffer
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB, MatDest must be a other matrix
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
MTH3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sw12_3D_M_vMulMatrixMatrix
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
MTH3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
/* ##M==================================================================================
NAME : sw12_3D_M_vMulTranspMatrixMatrixWithoutBuffer
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
MatDest must be a other matrix
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
MTH3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sw12_3D_M_vMulTranspMatrixMatrix
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
MTH3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
/* ##M==================================================================================
NAME : sw12_3D_M_vMulScalarMatrix
DESCRIPTION : Multiply a scalar with a matrix : MatDest= a*MatA
INPUT : MatDest : address of sw12_3D_tdstMatrix
a: SCA_td_sw12, MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulScalarMatrix(MatDest, a, MatA) \
MTH3D_M_vMulScalarMatrix(MatDest, a, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vDivScalarMatrix
DESCRIPTION : Divide a matrix by a scalar : MatDest= MatA/a
INPUT : MatDest : address of sw12_3D_tdstMatrix
MatA : address of sw12_3D_tdstMatrix, a: SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vDivScalarMatrix(MatDest, MatA, a) \
MTH3D_M_vDivScalarMatrix(MatDest, MatA, a)
/* ##M==================================================================================
NAME : sw12_3D_M_vSqrMatrix
DESCRIPTION : Square a matrix : MatDest= MatA*MatA
INPUT : MatDest : address of sw12_3D_tdstMatrix
MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSqrMatrix(MatDest, MatA) MTH3D_M_vSqrMatrix(MatDest, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vTranspMatrixWithoutBuffer
DESCRIPTION : Transpose a matrix : MatDest= transp MatA, Matdest must be a other matrix
INPUT : MatDest : address of sw12_3D_tdstMatrix
MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA) \
MTH3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA)
/* sw12_3D_M_vTranpMatrixWithoutBuffer(MatDest, MatA) : MatDest= transp MatA */
#define sw12_3D_M_vTranpMatrixWithoutBuffer sw12_3D_M_vTranspMatrixWithoutBuffer
/* ##M==================================================================================
NAME : sw12_3D_M_vTranspMatrix
DESCRIPTION : Transpose a matrix : MatDest= transp MatA
INPUT : MatDest : address of sw12_3D_tdstMatrix
MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vTranspMatrix(Mat_Dest, Mat_A) MTH3D_M_vTranspMatrix(Mat_Dest, Mat_A)
/* sw12_3D_M_vTranpMatrix(MatDest, MatA) : MatDest= transp MatA */
#define sw12_3D_M_vTranpMatrix sw12_3D_M_vTranspMatrix
/* ##M==================================================================================
NAME : sw12_3D_M_xTraceMatrix
DESCRIPTION : Return the trace of a matrix
INPUT : MatA : address of sw12_3D_tdstMatrix
OUTPUT : trace MatA : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xTraceMatrix(MatA) MTH3D_M_xTraceMatrix(MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetIdentityMatrix
DESCRIPTION : Set a matrix to the Identity matrix : MatDest= Id
INPUT : MatDest : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetIdentityMatrix(MatDest) MTH3D_M_vSetIdentityMatrix(MatDest)
/* ##M==================================================================================
NAME : sw12_3D_M_bEqualMatrix
DESCRIPTION : Test if two matrix are equal
INPUT : MatA, MatB : address of sw12_3D_tdstMatrix
OUTPUT : MatA==MatB : Boolean
=======================================================================================*/
#define sw12_3D_M_bEqualMatrix(MatA, MatB) MTH3D_M_bEqualMatrix(MatA, MatB)
/* ##M==================================================================================
NAME : sw12_3D_M_bMatchMatrix
DESCRIPTION : Test if two matrix are neary equal
INPUT : MatA, MatB : address of sw12_3D_tdstMatrix
eps : SCA_td_sw12
OUTPUT : (MatA match MatB to within about eps) : Boolean
=======================================================================================*/
#define sw12_3D_M_bMatchMatrix(MatA, MatB, eps) MTH3D_M_bMatchMatrix(MatA, MatB, eps)
/* ##M==================================================================================
NAME : sw12_3D_M_vFillMatrix
DESCRIPTION : Fill each matrix element with "a" value
INPUT : MatDest : address of sw12_3D_tdstMatrix
a : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vFillMatrix(MatDest, a) MTH3D_M_vFillMatrix(MatDest, a)
/* ##M==================================================================================
NAME : sw12_3D_M_xDetMatrix
DESCRIPTION : Return the determinant of a matrix
INPUT : MatA : address of sw12_3D_tdstMatrix
OUTPUT : det MatA : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xDetMatrix(MatA) MTH3D_M_xDetMatrix(MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vComMatrixWithoutBuffer
DESCRIPTION : Calculate the Cofactor Matrix of a matrix : MatDest= Cofactor Matrix of MatA
INPUT : Matdest, MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
MTH3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
/* ##M==================================================================================
NAME : sw12_3D_M_vInverMatrix
DESCRIPTION : Invert a matrix : MatDest= Inv MatA
INPUT : Matdest, MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vInverMatrix(MatDest, MatA) MTH3D_M_vInverMatrix(MatDest, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetMatrixColumnElements
DESCRIPTION : Get x, y, z column col values in MatA
INPUT : x, y, z : SCA_td_sw12
col : int
MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA) \
MTH3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetMatrixColumnElements
DESCRIPTION : Set column col x, y, z values in MatDest
INPUT : MatDest : address of sw12_3D_tdstMatrix
x, y, z : SCA_td_sw12
col : int
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col) \
MTH3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col)
/* ##M==================================================================================
NAME : sw12_3D_M_xGetMatrixElement
DESCRIPTION : Return element at (lin, col) in MatASet
INPUT : MatA : address of sw12_3D_tdstMatrix
lin, col : int
OUTPUT : a : SCA_td_sw12
=======================================================================================*/
#define sw12_3D_M_xGetMatrixElement( lin, col, MatA) MTH3D_M_xGetMatrixElement( lin, col, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetMatrixElement
DESCRIPTION : Set a element in MatDest at (lin, col)
INPUT : MatDest : address of sw12_3D_tdstMatrix
a : SCA_td_sw12
lin, col : int
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetMatrixElement( MatDest, a, lin, col) MTH3D_M_vSetMatrixElement( MatDest, a, lin, col)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetMatrixCol0Elements
DESCRIPTION : Set x, y, z values of column 0 in MatDest
INPUT : MatDest : address of sw12_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetMatrixCol1Elements
DESCRIPTION : Set x, y, z values of column 1 in MatDest
INPUT : MatDest : address of sw12_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetMatrixCol2Elements
DESCRIPTION : Set x, y, z values of column 2 in MatDest
INPUT : MatDest : address of sw12_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetMatrixLineXElements
DESCRIPTION : Set x elements of all columns in MatDest
INPUT : MatDest : address of sw12_3D_tdstMatrix
V0, V0, V0 : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetMatrixLineYElements
DESCRIPTION : Set y elements of all columns in MatDest
INPUT : MatDest : address of sw12_3D_tdstMatrix
V0, V0, V0 : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetMatrixLineZElements
DESCRIPTION : Set z elements of all columns in MatDest
INPUT : MatDest : address of sw12_3D_tdstMatrix
V0, V0, V0 : SCA_td_sw12
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetMatrixCol0Elements
DESCRIPTION : Get x, y, z values of column 0 in MatA
Vx, Vy, Vz : SCA_td_sw12
INPUT : MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetMatrixCol1Elements
DESCRIPTION : Get x, y, z values of column 1 in MatA
Vx, Vy, Vz : SCA_td_sw12
INPUT : MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetMatrixCol2Elements
DESCRIPTION : Get x, y, z values of column 2 in MatA
Vx, Vy, Vz : SCA_td_sw12
INPUT : MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetMatrixLineXElements
DESCRIPTION : Get x elements of all columns in MatA
V0, V0, V0 : SCA_td_sw12
INPUT : MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetMatrixLineYElements
DESCRIPTION : Get y elements of all columns in MatA
V0, V0, V0 : SCA_td_sw12
INPUT : MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetMatrixLineZElements
DESCRIPTION : Get z elements of all columns in MatA
V0, V0, V0 : SCA_td_sw12
INPUT : MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA)
/* ##-###########################
## Matrix-Vector operations
############################## */
/* ##M==================================================================================
NAME : sw12_3D_M_vMulMatrixVectorWithoutBuffer
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA, VectDest must be
a other vector
INPUT : VectDest : address of sw12_3D_tdstVector
MatA : address of sw12_3D_tdstMatrix
VectA : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA) \
MTH3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vMulMatrixVector
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA
INPUT : VectDest : address of sw12_3D_tdstVector
MatA : address of sw12_3D_tdstMatrix
VectA : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vMulMatrixVector( VectDest, MatA, VectA) \
MTH3D_M_vMulMatrixVector( VectDest, MatA, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetColumnInMatrix
DESCRIPTION : Get a Vector column of a Matrix to a Vector : VectDest= columm col of MatA
INPUT : VectDest : address of sw12_3D_tdstVector
MatA : address of sw12_3D_tdstMatrix
col : int
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetColumnInMatrix( VectDest, MatA, col ) \
MTH3D_M_vGetColumnInMatrix( VectDest, MatA, col )
/* ##M==================================================================================
NAME : sw12_3D_M_vSetColumnInMatrix
DESCRIPTION : Put a Vector to a column of a Matrix : Set columm col of MatDest with VectA
INPUT : MatDest : address of sw12_3D_tdstMatrix
VectA : address of sw12_3D_tdstVector
col : int
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetColumnInMatrix( MatDest, VectA, col) \
MTH3D_M_vSetColumnInMatrix( MatDest, VectA, col)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetLineInMatrix
DESCRIPTION : Get a Vector line of a Matrix to a Vector : VectDest= line lin of MatA
INPUT : VectDest : address of sw12_3D_tdstVector
MatA : address of sw12_3D_tdstMatrix
lin : int
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetLineInMatrix( VectDest, MatA, lin ) \
MTH3D_M_vGetLineInMatrix( VectDest, MatA, lin )
/* ##M==================================================================================
NAME : sw12_3D_M_vSetLineInMatrix
DESCRIPTION : Put a Vector to a line of a Matrix : Set line lin of MatDest with VectA
INPUT : MatDest : address of sw12_3D_tdstMatrix
VectA : address of sw12_3D_tdstVector
lin : int
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetLineInMatrix( MatDest, VectA, lin) \
MTH3D_M_vSetLineInMatrix( MatDest, VectA, lin)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetDiagInMatrix
DESCRIPTION : Get a Vector diagonal of a Matrix to a Vector : VectDest= diagonal of MatA
INPUT : VectDest : address of sw12_3D_tdstVector
MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetDiagInMatrix( VectDest, MatA) \
MTH3D_M_vGetDiagInMatrix( VectDest, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetDiagInMatrix
DESCRIPTION : Put a Vector to a diagonal of a Matrix : Set diagonal of MatDest with VectA
INPUT : MatDest : address of sw12_3D_tdstMatrix
VectA : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetDiagInMatrix( MatDest, VectA) \
MTH3D_M_vSetDiagInMatrix( MatDest, VectA)
/* ##M==================================================================================
NAME : sw12_3D_M_vGetVectorsInMatrix
DESCRIPTION : Get all column Matrix to two Vectors
INPUT : VaDest, VbDest, VcDest: address of sw12_3D_tdstVector
MatA : address of sw12_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA) \
MTH3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA)
/* ##M==================================================================================
NAME : sw12_3D_M_vSetVectorsInMatrix
DESCRIPTION : Set all column Matrix with two Vectors
INPUT : MatDest : address of sw12_3D_tdstMatrix
VectA, VectB, VectC : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw12_3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC) \
MTH3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC)
/* ##M==================================================================================
NAME : sw12_3D_M_vPrintfVector
DESCRIPTION : Print a Vector : Name + its values
INPUT : Name : string
VectA : address of sw12_3D_tdstVector
OUTPUT : void
=======================================================================================*/
__inline void Pf_sw12(td_sw12 _xValue)
{
printf( " %e",_xValue );
}
__inline void sw12_3D_fn_vPrintfVector( char * Name, sw12_3D_tdstVector * VectA)
{
MTH3D_M_vPrintfVector( Name, VectA );
}
#define sw12_3D_M_vPrintfVector( Name, VectA) sw12_3D_fn_vPrintfVector( Name, VectA)
#endif /* sw12_3D_H */

View File

@@ -0,0 +1,910 @@
/* ##H_FILE#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FILE : sw_3D.h
MODULE : sw (Common Mathematic Library)
DESCRIPTION : 3D Vectorial implementation
VERSION : sw V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
VERSION PC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* -----------------15/04/98 18:36-------------------
* Conversion : OK
* --------------------------------------------------*/
#ifndef _SCA_sw_3D_H_
#define _SCA_sw_3D_H_
#include "MTH\Specif\SCA\SCA_sw.h"
/* ##TYPEDEF#----------------------------------------------------------------------------
Types definition
---------------------------------------------------------------------------------------*/
/* 3D Vector : */
/*
#if 0
typedef VECTOR sw_3D_tdstVector;
#else
typedef struct sw_3D_tdstVector_
{
SCA_td_sw xX;
SCA_td_sw xY;
SCA_td_sw xZ;
SCA_td_sw pad;
} sw_3D_tdstVector;
#endif
*/
#define sw_3D_tdstVector MTH3D_tdstVector
/* 3D Matrix */
/*
typedef struct sw_3D_tdstMatrix_
{
sw_3D_tdstVector stCol_0;
sw_3D_tdstVector stCol_1;
sw_3D_tdstVector stCol_2;
} sw_3D_tdstMatrix;
*/
#define sw_3D_tdstMatrix MTH3D_tdstMatrix
/* ##MACRO#----------------------------------------------------------------------------
MACRO definition
---------------------------------------------------------------------------------------*/
/*+ ##-######################################
## MACRO AND FUNCTION FOR 3D MATHEMATICS
######################################### */
/* ##-###########################
## Vector Operations
############################## */
/* ##M==================================================================================
NAME : sw_3D_M_vAddVector
DESCRIPTION : Add two vectors : VectDest= VectA + VectB
INPUT : VectDest, VectA, VectB : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vAddVector( VectDest, VectA, VectB) MTH3D_M_vAddVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_vSubVector
DESCRIPTION : Sub two vectors : VectDest= VectA - VectB
INPUT : VectDest, VectA, VectB : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSubVector( VectDest, VectA, VectB) MTH3D_M_vSubVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_vNegVector
DESCRIPTION : Negation of a vector : VectDest= - VectA
INPUT : VectDest, VectA : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vNegVector( VectDest, VectA) MTH3D_M_vNegVector( VectDest, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_bEqualVector
DESCRIPTION : Test if two vectors are equal
INPUT : VectA, VectB : address of sw_3D_tdstVector
OUTPUT : VectA==VectB : Boolean
=======================================================================================*/
#define sw_3D_M_bEqualVector( VectA, VectB) MTH3D_M_bEqualVector( VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_vAddScalarVector
DESCRIPTION : Add a scalare with a vector : VectDest= a.Id + VectA
INPUT : VectDest: address of sw_3D_tdstVector,
a: SCA_td_sw, VectA: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vAddScalarVector( VectDest, a, VectA) MTH3D_M_vAddScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vSubScalarVector
DESCRIPTION : Add a scalare with a vector : VectDest= VectA - a.Id
INPUT : VectDest: address of sw_3D_tdstVector,
a: SCA_td_sw, VectA: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSubScalarVector( VectDest, a, VectA) MTH3D_M_vSubScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vMulScalarVector
DESCRIPTION : Multiplicate a scalare with a vector : VectDest= a*VectA
INPUT : VectDest: address of sw_3D_tdstVector,
a: SCA_td_sw, VectA: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulScalarVector( VectDest, a, VectA) MTH3D_M_vMulScalarVector( VectDest, a, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vDivScalarVector
DESCRIPTION : Divide a vector by a scalare : VectDest= VectA/a
INPUT : VectDest, VectA: address of sw_3D_tdstVector, a: SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vDivScalarVector( VectDest, VectA, a) MTH3D_M_vDivScalarVector( VectDest, VectA, a)
/* ##M==================================================================================
NAME : sw_3D_M_xDotProductVector
DESCRIPTION : Return the Dot Product of two vectors
INPUT : VectA, VectB : address of sw_3D_tdstVector
OUTPUT : VectA.VectB : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xDotProductVector( VectA, VectB) MTH3D_M_xDotProductVector( VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_vCrossProductVectorWithoutBuffer
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB,
VectDest must be a other vector
INPUT : VectDest, VectA, VectA: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_fn_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB) \
MTH3D_M_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB)
#define sw_3D_M_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB) \
sw_3D_fn_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_vCrossProductVector
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB
INPUT : VectDest, VectA, VectA: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vCrossProductVector(VectDest,VectA,VectB) MTH3D_M_vCrossProductVector(VectDest,VectA,VectB)
/* ##M==================================================================================
NAME : sw_3D_M_xSqrVector
DESCRIPTION : Return the square of a vector
INPUT : VectA : address of sw_3D_tdstVector
OUTPUT : VectA.VectA : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xSqrVector( VectA) MTH3D_M_xSqrVector( VectA )
/* ##M==================================================================================
NAME : sw_3D_M_xNormVector
DESCRIPTION : Return the norm of a vector
INPUT : VectA : address of sw_3D_tdstVector
OUTPUT : ||VectA|| : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xNormVector( VectA ) MTH3D_M_xNormVector( VectA )
/* ##M==================================================================================
NAME : sw_3D_M_xInvNormVector
DESCRIPTION : Return the inverse of the norm of a vector
INPUT : VectA : address of sw_3D_tdstVector
OUTPUT : 1/||VectA|| : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xInvNormVector( VectA ) MTH3D_M_xInvNormVector( VectA )
/* ##M==================================================================================
NAME : sw_3D_M_xVectorGapSqr
DESCRIPTION : Return the square Gap between two vectors
INPUT : VectA, VectB : address of sw_3D_tdstVector
OUTPUT : Sqr(||VectA-VectB||) : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xVectorGapSqr(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_xVectorGap
DESCRIPTION : Return the Gap between two vectors
INPUT : VectA, VectB : address of sw_3D_tdstVector
OUTPUT : ||VectA-VectB|| : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xVectorGap(VectA, VectB) MTH3D_M_xVectorGap(VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_vFillVector
DESCRIPTION : Fill each vector element with a value
INPUT : VectA: address of sw_3D_tdstVector, a: SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vFillVector( VectDest, a) MTH3D_M_vFillVector( VectDest, a)
/* ##M==================================================================================
NAME : sw_3D_M_vNormalizeVector
DESCRIPTION : Normalize a vector : VectDest= VectA/||VectA||
INPUT : VectDest, VectA : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vNormalizeVector(VectDest, VectA) MTH3D_M_vNormalizeVector(VectDest, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetVectorElements
DESCRIPTION : Get x, y, z values of a vector
INPUT : x, y, z : address of SCA_td_sw, VectA : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetVectorElements( Vx, Vy, Vz, VectA) MTH3D_M_vGetVectorElements( Vx, Vy, Vz, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vSetVectorElements
DESCRIPTION : Set a vector with x, y, z values
INPUT : VectDest : address of sw_3D_tdstVector, x, y, z : address of SCA_td_sw,
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz) MTH3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sw_3D_M_xGetXofVector
DESCRIPTION : Return x element of a vector
INPUT : VectA : address of sw_3D_tdstVector
OUTPUT : x : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xGetXofVector( VectA ) MTH3D_M_xGetXofVector( VectA )
/* ##M==================================================================================
NAME : sw_3D_M_vSetXofVector
DESCRIPTION : Set x element of a vector
INPUT : VectDest : address of sw_3D_tdstVector, Vx : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetXofVector( VectDest, Vx) MTH3D_M_vSetXofVector( VectDest, Vx)
/* ##M==================================================================================
NAME : sw_3D_M_xGetYofVector
DESCRIPTION : Return y element of a vector
INPUT : VectA : address of sw_3D_tdstVector
OUTPUT : y : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xGetYofVector( VectA ) MTH3D_M_xGetYofVector( VectA )
/* ##M==================================================================================
NAME : sw_3D_M_vSetYofVector
DESCRIPTION : Set y element of a vector
INPUT : VectDest : address of sw_3D_tdstVector, Vy : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetYofVector( VectDest, Vy) MTH3D_M_vSetYofVector( VectDest, Vy)
/* ##M==================================================================================
NAME : sw_3D_M_xGetZofVector
DESCRIPTION : Return z element of a vector
INPUT : VectA : address of sw_3D_tdstVector
OUTPUT : z : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xGetZofVector( VectA ) MTH3D_M_xGetZofVector( VectA )
/* ##M==================================================================================
NAME : sw_3D_M_vSetZofVector
DESCRIPTION : Set z element of a vector
INPUT : VectDest : address of sw_3D_tdstVector, Vz : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetZofVector( VectDest, Vz) MTH3D_M_vSetZofVector( VectDest, Vz)
/* ##M==================================================================================
NAME : sw_3D_M_vCopyVector
DESCRIPTION : Copy a vector : VectDest=VectA
INPUT : VectDest, VectA : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vCopyVector( VectDest, VectA) MTH3D_M_vCopyVector( VectDest, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vNullVector
DESCRIPTION : Set all elements of a vector to zero
INPUT : VectDest : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vNullVector( VectDest) MTH3D_M_vNullVector( VectDest)
/* ##M==================================================================================
NAME : sw_3D_M_vScaleVector
DESCRIPTION : Set each element of VectDest with the multiplication of element of VectA by element of VectB
INPUT : VectDest, VectA, VectB : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vScaleVector( VectDest, VectA, VectB ) MTH3D_M_vScaleVector( VectDest, VectA, VectB )
/* ##M==================================================================================
NAME : sw_3D_M_vMiddleVector
DESCRIPTION : Calculate the middle of two vectors : VectDest= (VectA+VectB)/2
INPUT : VectDest, VectA, VectB : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMiddleVector( VectDest, VectA, VectB ) MTH3D_M_vMiddleVector( VectDest, VectA, VectB )
/* ##M==================================================================================
NAME : sw_3D_M_vLinearInterpolVector
DESCRIPTION : Calculate the lineat interpolation of two vectors : VectDest= VectA + t.(VectB-VectA)
INPUT : VectDest, VectA, VectB: address of sw_3D_tdstVector, t: SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t) MTH3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t)
/* ##M==================================================================================
NAME : sw_3D_M_vMaxVector
DESCRIPTION : Make a vector with max elements of two other vectors
INPUT : VectDest, VectA, VectB: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMaxVector( VectDest, VectA, VectB) MTH3D_M_vMaxVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_vMinVector
DESCRIPTION : Make a vector with min elements of two other vectors
INPUT : VectDest, VectA, VectB: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMinVector( VectDest, VectA, VectB) MTH3D_M_vMinVector( VectDest, VectA, VectB)
/* ##M==================================================================================
NAME : sw_3D_M_xDetxYVector
DESCRIPTION : Return the 2D determinant between X and Y elements
INPUT : VectA, VectB: address of sw_3D_tdstVector
OUTPUT : DetxY |VectA, VectB| : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xDetxYVector( VectA, VectB ) MTH3D_M_xDetxYVector( VectA, VectB )
/* ##M==================================================================================
NAME : sw_3D_M_xDetYZVector
DESCRIPTION : Return the 2D determinant between Y and Z elements
INPUT : VectA, VectB: address of sw_3D_tdstVector
OUTPUT : DetYZ |VectA, VectB| : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xDetYZVector( VectA, VectB ) MTH3D_M_xDetYZVector( VectA, VectB )
/* ##M==================================================================================
NAME : sw_3D_M_xDetZXVector
DESCRIPTION : Return the 2D determinant between Z and X elements
INPUT : VectA, VectB: address of sw_3D_tdstVector
OUTPUT : DetZX |VectA, VectB| : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xDetZXVector( VectA, VectB ) MTH3D_M_xDetZXVector( VectA, VectB )
/* ##M==================================================================================
NAME : sw_3D_M_bIsNullVector
DESCRIPTION : Test if a vector is null
INPUT : VectA : address of sw_3D_tdstVector
OUTPUT : VectA==Null vector : Boolean
=======================================================================================*/
#define sw_3D_M_bIsNullVector( VectA ) MTH3D_M_bIsNullVector( VectA )
/* ##M==================================================================================
NAME : sw_3D_M_vMulAddVector
DESCRIPTION : Multiply a scalar to a vector, and add it to a other vector: VectDest = x.VectA + VectB
INPUT : VectDest: address of sw_3D_tdstVector,
x: SCA_td_sw, VectA, VectB : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulAddVector( VectDest, x, VectA, VectB) MTH3D_M_vMulAddVector( VectDest, x, VectA, VectB)
/* sw_3D_M_vMullAddVector( VectDest, x, VectA, VectB) : VectDest = x.VectA + VectB */
#define sw_3D_M_vMullAddVector sw_3D_M_vMulAddVector
/* ##M==================================================================================
NAME : sw_3D_M_vSetBaseIVector
DESCRIPTION : Set a vector to Ox base vector : VectDest = ( 1, 0, 0 )
INPUT : VectDest: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetBaseIVector( VectDest ) MTH3D_M_vSetBaseIVector( VectDest )
/* ##M==================================================================================
NAME : sw_3D_M_vSetBaseJVector
DESCRIPTION : Set a vector to Oy base vector : VectDest = ( 0, 1, 0 )
INPUT : VectDest: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetBaseJVector( VectDest ) MTH3D_M_vSetBaseJVector( VectDest )
/* ##M==================================================================================
NAME : sw_3D_M_vSetBaseKVector
DESCRIPTION : Set a vector to Oz base vector : VectDest = ( 0, 0, 1 )
INPUT : VectDest: address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetBaseKVector( VectDest ) MTH3D_M_vSetBaseKVector( VectDest )
/* ##-###########################
## Matrix operations
############################## */
/* ##M==================================================================================
NAME : sw_3D_M_vCopyMatrix
DESCRIPTION : Copy MatA in MatDest
INPUT : MatDest, MatA: address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vCopyMatrix( MatDest, MatA) MTH3D_M_vCopyMatrix( MatDest, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vAddMatrix
DESCRIPTION : Add two matrix : MatDest= MatA + MatB
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vAddMatrix( MatDest, MatA, MatB) MTH3D_M_vAddMatrix( MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sw_3D_M_vSubMatrix
DESCRIPTION : Sub two matrix : MatDest= MatA - MatB
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSubMatrix( MatDest, MatA, MatB) MTH3D_M_vSubMatrix( MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sw_3D_M_vNegMatrix
DESCRIPTION : Make the Nagation of a matrix : MatDest= -MatA
INPUT : MatDest, MatA: address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vNegMatrix( MatDest, MatA) MTH3D_M_vNegMatrix( MatDest, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vMulMatrixMatrixWithoutBuffer
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB, MatDest must be a other matrix
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
MTH3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sw_3D_M_vMulMatrixMatrix
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
MTH3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
/* ##M==================================================================================
NAME : sw_3D_M_vMulTranspMatrixMatrixWithoutBuffer
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
MatDest must be a other matrix
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
MTH3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
/* ##M==================================================================================
NAME : sw_3D_M_vMulTranspMatrixMatrix
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
MTH3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
/* ##M==================================================================================
NAME : sw_3D_M_vMulScalarMatrix
DESCRIPTION : Multiply a scalar with a matrix : MatDest= a*MatA
INPUT : MatDest : address of sw_3D_tdstMatrix
a: SCA_td_sw, MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulScalarMatrix(MatDest, a, MatA) \
MTH3D_M_vMulScalarMatrix(MatDest, a, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vDivScalarMatrix
DESCRIPTION : Divide a matrix by a scalar : MatDest= MatA/a
INPUT : MatDest : address of sw_3D_tdstMatrix
MatA : address of sw_3D_tdstMatrix, a: SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vDivScalarMatrix(MatDest, MatA, a) \
MTH3D_M_vDivScalarMatrix(MatDest, MatA, a)
/* ##M==================================================================================
NAME : sw_3D_M_vSqrMatrix
DESCRIPTION : Square a matrix : MatDest= MatA*MatA
INPUT : MatDest : address of sw_3D_tdstMatrix
MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSqrMatrix(MatDest, MatA) MTH3D_M_vSqrMatrix(MatDest, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vTranspMatrixWithoutBuffer
DESCRIPTION : Transpose a matrix : MatDest= transp MatA, Matdest must be a other matrix
INPUT : MatDest : address of sw_3D_tdstMatrix
MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA) \
MTH3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA)
/* sw_3D_M_vTranpMatrixWithoutBuffer(MatDest, MatA) : MatDest= transp MatA */
#define sw_3D_M_vTranpMatrixWithoutBuffer sw_3D_M_vTranspMatrixWithoutBuffer
/* ##M==================================================================================
NAME : sw_3D_M_vTranspMatrix
DESCRIPTION : Transpose a matrix : MatDest= transp MatA
INPUT : MatDest : address of sw_3D_tdstMatrix
MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vTranspMatrix(Mat_Dest, Mat_A) MTH3D_M_vTranspMatrix(Mat_Dest, Mat_A)
/* sw_3D_M_vTranpMatrix(MatDest, MatA) : MatDest= transp MatA */
#define sw_3D_M_vTranpMatrix sw_3D_M_vTranspMatrix
/* ##M==================================================================================
NAME : sw_3D_M_xTraceMatrix
DESCRIPTION : Return the trace of a matrix
INPUT : MatA : address of sw_3D_tdstMatrix
OUTPUT : trace MatA : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xTraceMatrix(MatA) MTH3D_M_xTraceMatrix(MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vSetIdentityMatrix
DESCRIPTION : Set a matrix to the Identity matrix : MatDest= Id
INPUT : MatDest : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetIdentityMatrix(MatDest) MTH3D_M_vSetIdentityMatrix(MatDest)
/* ##M==================================================================================
NAME : sw_3D_M_bEqualMatrix
DESCRIPTION : Test if two matrix are equal
INPUT : MatA, MatB : address of sw_3D_tdstMatrix
OUTPUT : MatA==MatB : Boolean
=======================================================================================*/
#define sw_3D_M_bEqualMatrix(MatA, MatB) MTH3D_M_bEqualMatrix(MatA, MatB)
/* ##M==================================================================================
NAME : sw_3D_M_bMatchMatrix
DESCRIPTION : Test if two matrix are neary equal
INPUT : MatA, MatB : address of sw_3D_tdstMatrix
eps : SCA_td_sw
OUTPUT : (MatA match MatB to within about eps) : Boolean
=======================================================================================*/
#define sw_3D_M_bMatchMatrix(MatA, MatB, eps) MTH3D_M_bMatchMatrix(MatA, MatB, eps)
/* ##M==================================================================================
NAME : sw_3D_M_vFillMatrix
DESCRIPTION : Fill each matrix element with "a" value
INPUT : MatDest : address of sw_3D_tdstMatrix
a : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vFillMatrix(MatDest, a) MTH3D_M_vFillMatrix(MatDest, a)
/* ##M==================================================================================
NAME : sw_3D_M_xDetMatrix
DESCRIPTION : Return the determinant of a matrix
INPUT : MatA : address of sw_3D_tdstMatrix
OUTPUT : det MatA : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xDetMatrix(MatA) MTH3D_M_xDetMatrix(MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vComMatrixWithoutBuffer
DESCRIPTION : Calculate the Cofactor Matrix of a matrix : MatDest= Cofactor Matrix of MatA
INPUT : Matdest, MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
MTH3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
/* ##M==================================================================================
NAME : sw_3D_M_vInverMatrix
DESCRIPTION : Invert a matrix : MatDest= Inv MatA
INPUT : Matdest, MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vInverMatrix(MatDest, MatA) MTH3D_M_vInverMatrix(MatDest, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetMatrixColumnElements
DESCRIPTION : Get x, y, z column col values in MatA
INPUT : x, y, z : SCA_td_sw
col : int
MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA) \
MTH3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vSetMatrixColumnElements
DESCRIPTION : Set column col x, y, z values in MatDest
INPUT : MatDest : address of sw_3D_tdstMatrix
x, y, z : SCA_td_sw
col : int
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col) \
MTH3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col)
/* ##M==================================================================================
NAME : sw_3D_M_xGetMatrixElement
DESCRIPTION : Return element at (lin, col) in MatASet
INPUT : MatA : address of sw_3D_tdstMatrix
lin, col : int
OUTPUT : a : SCA_td_sw
=======================================================================================*/
#define sw_3D_M_xGetMatrixElement( lin, col, MatA) MTH3D_M_xGetMatrixElement( lin, col, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vSetMatrixElement
DESCRIPTION : Set a element in MatDest at (lin, col)
INPUT : MatDest : address of sw_3D_tdstMatrix
a : SCA_td_sw
lin, col : int
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetMatrixElement( MatDest, a, lin, col) MTH3D_M_vSetMatrixElement( MatDest, a, lin, col)
/* ##M==================================================================================
NAME : sw_3D_M_vSetMatrixCol0Elements
DESCRIPTION : Set x, y, z values of column 0 in MatDest
INPUT : MatDest : address of sw_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sw_3D_M_vSetMatrixCol1Elements
DESCRIPTION : Set x, y, z values of column 1 in MatDest
INPUT : MatDest : address of sw_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sw_3D_M_vSetMatrixCol2Elements
DESCRIPTION : Set x, y, z values of column 2 in MatDest
INPUT : MatDest : address of sw_3D_tdstMatrix
Vx, Vy, Vz : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz) \
MTH3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz)
/* ##M==================================================================================
NAME : sw_3D_M_vSetMatrixLineXElements
DESCRIPTION : Set x elements of all columns in MatDest
INPUT : MatDest : address of sw_3D_tdstMatrix
V0, V0, V0 : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sw_3D_M_vSetMatrixLineYElements
DESCRIPTION : Set y elements of all columns in MatDest
INPUT : MatDest : address of sw_3D_tdstMatrix
V0, V0, V0 : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sw_3D_M_vSetMatrixLineZElements
DESCRIPTION : Set z elements of all columns in MatDest
INPUT : MatDest : address of sw_3D_tdstMatrix
V0, V0, V0 : SCA_td_sw
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2) \
MTH3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2)
/* ##M==================================================================================
NAME : sw_3D_M_vGetMatrixCol0Elements
DESCRIPTION : Get x, y, z values of column 0 in MatA
Vx, Vy, Vz : SCA_td_sw
INPUT : MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetMatrixCol1Elements
DESCRIPTION : Get x, y, z values of column 1 in MatA
Vx, Vy, Vz : SCA_td_sw
INPUT : MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetMatrixCol2Elements
DESCRIPTION : Get x, y, z values of column 2 in MatA
Vx, Vy, Vz : SCA_td_sw
INPUT : MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA) \
MTH3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetMatrixLineXElements
DESCRIPTION : Get x elements of all columns in MatA
V0, V0, V0 : SCA_td_sw
INPUT : MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetMatrixLineYElements
DESCRIPTION : Get y elements of all columns in MatA
V0, V0, V0 : SCA_td_sw
INPUT : MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetMatrixLineZElements
DESCRIPTION : Get z elements of all columns in MatA
V0, V0, V0 : SCA_td_sw
INPUT : MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA) \
MTH3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA)
/* ##-###########################
## Matrix-Vector operations
############################## */
/* ##M==================================================================================
NAME : sw_3D_M_vMulMatrixVectorWithoutBuffer
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA, VectDest must be
a other vector
INPUT : VectDest : address of sw_3D_tdstVector
MatA : address of sw_3D_tdstMatrix
VectA : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA) \
MTH3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vMulMatrixVector
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA
INPUT : VectDest : address of sw_3D_tdstVector
MatA : address of sw_3D_tdstMatrix
VectA : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vMulMatrixVector( VectDest, MatA, VectA) \
MTH3D_M_vMulMatrixVector( VectDest, MatA, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetColumnInMatrix
DESCRIPTION : Get a Vector column of a Matrix to a Vector : VectDest= columm col of MatA
INPUT : VectDest : address of sw_3D_tdstVector
MatA : address of sw_3D_tdstMatrix
col : int
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetColumnInMatrix( VectDest, MatA, col ) \
MTH3D_M_vGetColumnInMatrix( VectDest, MatA, col )
/* ##M==================================================================================
NAME : sw_3D_M_vSetColumnInMatrix
DESCRIPTION : Put a Vector to a column of a Matrix : Set columm col of MatDest with VectA
INPUT : MatDest : address of sw_3D_tdstMatrix
VectA : address of sw_3D_tdstVector
col : int
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetColumnInMatrix( MatDest, VectA, col) \
MTH3D_M_vSetColumnInMatrix( MatDest, VectA, col)
/* ##M==================================================================================
NAME : sw_3D_M_vGetLineInMatrix
DESCRIPTION : Get a Vector line of a Matrix to a Vector : VectDest= line lin of MatA
INPUT : VectDest : address of sw_3D_tdstVector
MatA : address of sw_3D_tdstMatrix
lin : int
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetLineInMatrix( VectDest, MatA, lin ) \
MTH3D_M_vGetLineInMatrix( VectDest, MatA, lin )
/* ##M==================================================================================
NAME : sw_3D_M_vSetLineInMatrix
DESCRIPTION : Put a Vector to a line of a Matrix : Set line lin of MatDest with VectA
INPUT : MatDest : address of sw_3D_tdstMatrix
VectA : address of sw_3D_tdstVector
lin : int
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetLineInMatrix( MatDest, VectA, lin) \
MTH3D_M_vSetLineInMatrix( MatDest, VectA, lin)
/* ##M==================================================================================
NAME : sw_3D_M_vGetDiagInMatrix
DESCRIPTION : Get a Vector diagonal of a Matrix to a Vector : VectDest= diagonal of MatA
INPUT : VectDest : address of sw_3D_tdstVector
MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetDiagInMatrix( VectDest, MatA) \
MTH3D_M_vGetDiagInMatrix( VectDest, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vSetDiagInMatrix
DESCRIPTION : Put a Vector to a diagonal of a Matrix : Set diagonal of MatDest with VectA
INPUT : MatDest : address of sw_3D_tdstMatrix
VectA : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetDiagInMatrix( MatDest, VectA) \
MTH3D_M_vSetDiagInMatrix( MatDest, VectA)
/* ##M==================================================================================
NAME : sw_3D_M_vGetVectorsInMatrix
DESCRIPTION : Get all column Matrix to two Vectors
INPUT : VaDest, VbDest, VcDest: address of sw_3D_tdstVector
MatA : address of sw_3D_tdstMatrix
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA) \
MTH3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA)
/* ##M==================================================================================
NAME : sw_3D_M_vSetVectorsInMatrix
DESCRIPTION : Set all column Matrix with two Vectors
INPUT : MatDest : address of sw_3D_tdstMatrix
VectA, VectB, VectC : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
#define sw_3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC) \
MTH3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC)
/* ##M==================================================================================
NAME : sw_3D_M_vPrintfVector
DESCRIPTION : Print a Vector : Name + its values
INPUT : Name : string
VectA : address of sw_3D_tdstVector
OUTPUT : void
=======================================================================================*/
__inline void Pf_sw(td_sw _xValue)
{
printf( " %e",_xValue );
}
__inline void sw_3D_fn_vPrintfVector( char * Name, sw_3D_tdstVector * VectA)
{
MTH3D_M_vPrintfVector( Name, VectA );
}
#define sw_3D_M_vPrintfVector( Name, VectA) sw_3D_fn_vPrintfVector( Name, VectA)
#endif /* sw_3D_H */