Hyperbolic functions

Pau Garcia i Quiles pgquiles at elpauer.org
Fri May 30 09:34:27 CEST 2008


Hello,

As MSVC does not implement atanh, it's being defined in  
kdeedu/marble/src/lib/PlaceMarkLayout.cpp and  
kdeedu/marble/src/lib/Projections/MercatorProjection.cpp as:

#ifdef Q_CC_MSVC
static double msvc_atanh(double x)
{
   return ( 0.5 * log( ( 1.0 + x ) / ( 1.0 - x ) ) );
}
#define atanh msvc_atanh
#endif

Now I've copied that to  
kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h and  
kdeedu/marble/src/lib/VectorMap.cpp too, which means the same code is  
duplicated in 4 different places.

Also, I moved the definition of msvc_asinh from  
kdeedu/marble/src/lib/EquirectScanlineTextureMapper.cpp to  
kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h, which is  
included by EquirectScanlineTextureMapper.h, which is included by  
EquirectScanlineTextureMapper.cpp. This has been just a coincidence,  
we may have ended up with the same code in 2 different places.

Wouldn't it make sense to move the definition of hyperbolic functions  
to some other place, maybe inlined in msvc/math.h :-?

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)



More information about the Kde-windows mailing list