📄 xmathfunc.inl
字号:
#ifndef __XMATH_FUNC_INLINE_INCLUDE__
#define __XMATH_FUNC_INLINE_INCLUDE__
#ifndef IN_MATHLIB_NAMESPACE
#error You cann't include this file out the XMathLib namespace
#endif
template <typename T> void _MATH_LIB_EXPORT_ XM_Swap(T& arg1,T& arg2)
{
T temp= arg1;
arg1 = arg2;
arg2 = temp;
return ;
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_Rad2Deg(float rad)
{
return (float)rad / (float)XM_PI * 180;
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_Deg2Rad(float deg)
{
return (float)deg / 180 * (float)XM_PI;
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_CosD(float angle)
{
angle = (float)angle / 180 * (float)XM_PI;
return (float)cos(angle);
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_SinD(float angle)
{
angle = (float)angle / 180 * (float)XM_PI;
return (float)sin(angle);
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_ACosD(float c)
{
float rt = (float)acos(c);
return (float)(rt / XM_PI * 180);
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_ASinD(float s)
{
float rt = (float)asin(s);
return (float)(rt / XM_PI * 180);
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_CosR(float angle)
{
return (float)cos(angle);
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_SinR(float angle)
{
return (float)sin(angle);
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_ACosR(float c)
{
return (float)acos(c);
}
__FORCE_INLINE__ float _MATH_LIB_EXPORT_ XM_ASinR(float s)
{
return (float)asin(s);
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -