|
Geometry : |
Subject: [ggl] Hello + some newbie questions
From: Barend (barend)
Date: 2009-05-05 20:04:57
Hi Mateusz,
>
>> Or remove out own constants and use boost::math::* directly in all
>> ggl:: code?
>>
>
> I have applied (r685, r686) use of boost::math::constants for PI and for
> HALF.
> Also, I const-qualified intermediate results in functions, to be sure
> compilers will always optimize these values.
>
Perfect!
> I think the ggl::math::hav function could be template for easy
> interchangeable use with float and double types:
>
> template <typename T>
> inline T hav(T const& theta)
> {
> using boost::math::constants::half;
> T const sn = std::sin(half<T>() * theta);
> return sn * sn;
> }
>
Good idea, actually I was thinking the same when I revisited this one of
these days. Strange it was not there.
> Same ggl::math::sqrt.
>
OK (it is "sqr" and maybe it can go).
Regards, Barend
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20090505/fcbe5ae0/attachment-0001.html
Geometry list run by mateusz at loskot.net