diff --git a/inc/hgl/math/PhysicsConst.h b/inc/hgl/math/PhysicsConst.h index ceca80e..15fa877 100644 --- a/inc/hgl/math/PhysicsConst.h +++ b/inc/hgl/math/PhysicsConst.h @@ -75,5 +75,41 @@ namespace hgl { return m0/sqrt(1-(v*v)/(HGL_SPEED_OF_LIGHT*HGL_SPEED_OF_LIGHT)); } + + /** + * 摄氏度到华氏度 + */ + template + inline T Celsius2Fahrenheit(const T &c) + { + return c*1.8+32; + } + + /** + * 华氏度到摄氏度 + */ + template + inline T Fahrenheit2Celsius(const T &f) + { + return (f - 32) / 1.8; + } + + /** + * 摄氏度到开氏度 + */ + template + inline T Celsius2Kelvin(const T &c) + { + return c + 273.15; + } + + /** + * 开氏度到摄氏度 + */ + template + inline T Kelvin2Celsius(const T &k) + { + return k - 273.15; + } }//namespace hgl #endif//HGL_MATH_PHYSICS_CONST_INCLUDE diff --git a/inc/hgl/type/String.h b/inc/hgl/type/String.h index 4baeb75..2cf8fad 100644 --- a/inc/hgl/type/String.h +++ b/inc/hgl/type/String.h @@ -188,7 +188,7 @@ namespace hgl return(data.valid()?data->GetFirstChar():0); } - const T GetLastChar()const ///<取得当前字符串最后一个字符 + const T GetLastChar()const ///<取得当前字符串最后一个字符 { // if(!this)return(0); return(data.valid()?data->GetLastChar():0);