/*=========================================================================
*
* Util.h	- Math functions
*
* Version			1.0
* Revision date
*
*=======================================================================*/
#ifndef UTIL_H
#define UTIL_H

//--- Includes --------------------------------------------------------

#include "MTH.h"


//--- Defines --------------------------------------------------------

#define MLT_C_InfinitPlus       (float)  3.402822E38
#define MLT_C_InfinitMinus      (float) -3.402822E38


#define MLT_M_FloatToValue(A)   MTH_M_xFloatToReal(A)
#define MLT_M_1616ToValue(A)    MTH_M_xFixed16_16ToReal(A)
#define MLT_M_ValueToFloat(A)   MTH_M_xRealToFloat(A)
#define MLT_M_ValueTo1616(A)    MTH_M_xRealToFixed16_16(A)
#define MLT_M_ValueToLong(A)    MTH_M_xRealToLong( A )
#define MLT_M_LongToValue(A)    MTH_M_xLongToReal( A )
#define MLT_M_Mul(A,B)          MTH_M_xMul(A, B)
#define MLT_M_Sub(A,B)          MTH_M_xSub(A, B)
#define MLT_M_Add(A,B)          MTH_M_xAdd(A, B)
#define MLT_M_Div(A,B)          MTH_M_xDiv(A, B)
#define MLT_M_Neg(A)            MTH_M_xNeg(A)
#define MLT_M_Sgn(A)            MTH_M_xSign(A)                                  

#define MLT_M_Inv(A)            MTH_M_xInv(A)
#define MLT_M_Abs(A)            MTH_M_xAbs(A)
#define MLT_M_Sqrt(A)           MTH_M_xSqrt(A)

#define MLT_M_DegToAng(A)		MTH_M_xDegToRad(A)
#define MLT_M_AngToRad(A)		(MTH_tdxReal)( ( A ) )
#define MLT_M_Cos(A)			MTH_M_xCos(A)     
#define MLT_M_Sin(A)			MTH_M_xSin(A)     
#define MLT_M_Tan(A)			MTH_M_xTan(A)     
#define MLT_M_Atan(A)			MTH_M_xATan(A)
#define MLT_M_Cotan(A)			MTH_M_xCoTan(A)
#define MLT_M_PI				MTH_C_Pi
#define MLT_M_2PI				MTH_C_2Pi
#define MLT_M_PIO2				MTH_C_PiBy2
#define MLT_M_PIO4				MTH_C_PiBy4


#endif // UTIL_H
