<div class="gmail_quote"><div>I would strongly support getting rid of DoublePi also it is just too confusing. I see no reason for a FloatPi because if you really want a float you cane just do the coercion directly as needed.</div>
<div><br></div><div>Regards</div><div>   Andrew</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---------- Forwarded message ----------<br>
From: Berk Geveci <<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>><br>To: David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>><br>Cc: VTK Developers <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>><br>
Date: Thu, 1 Mar 2012 10:44:00 -0500<br>Subject: Re: [vtk-developers] DoublePi proposal<br>+1<div><br></div><div>I would get rid of DoublePi in 6.0 since we are cleaning up so much stuff.<br><br><div class="gmail_quote">On Thu, Mar 1, 2012 at 12:57 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Well, I looked through VTK to see how vtkMath::Pi() was being used,<br>
and now I don't think that there is any reason for a single-precision<br>
pi at all.  In VTK 6, vtkMath::Pi() should return a double-precision<br>
value, period.<br>
<br>
I found 62 classes that call vtkMath::Pi().  Only one of them,<br>
vtkExodusReader, seemed to have a reason for using a single-precision<br>
value.  The others should have switched to vtkMath::DoublePi() a long<br>
time ago.  My only guess as to why they weren't is that they were<br>
missed during the big float-to-double conversion that occurred when<br>
VTK 4.4 was released.<br>
<br>
So my new proposal is to do nothing for VTK 5.10 (because<br>
vtkMath::FloatPi() isn't really needed for anything), but to still<br>
change vtkMath::Pi() to "double" for VTK 6.  Then eventually<br>
vtkMath::DoublePi() can be deprecated.<br>
<span><font color="#888888"><br>
 - David<br>
</font></span><div><div><br>
<br>
<br>
On Wed, Feb 29, 2012 at 5:17 PM, David Gobbi <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>> wrote:<br>
> Hi J-C,<br>
><br>
> All of those are good examples of why vtkMath:Pi() should be<br>
> returning double instead of float... in each of those four locations,<br>
> a double-precision Pi should be used instead of a single-precision Pi.<br>
> So don't changed them to FloatPi().<br>
><br>
> I've also noticed that many of the vtkParametricFunction subclasses in<br>
> VTK are using vtkMath::Pi() when they should be using  double-precision pi.<br>
><br>
>  - David<br>
><br>
><br>
> On Wed, Feb 29, 2012 at 4:44 PM, Jean-Christophe Fillion-Robin<br>
> <<a href="mailto:jchris.fillionr@kitware.com" target="_blank">jchris.fillionr@kitware.com</a>> wrote:<br>
>> Within Slicer vtkMath::Pi() is called at four location.  See details below.<br>
>><br>
>> We will make sure to use vtkMath::FloatPi() when we will integrate VTK 5.10.<br>
>><br>
>> Thanks<br>
>> Jc<br>
>><br>
>><br>
>><br>
>> Modules/Loadable/Annotations/VTKWidgets/vtkAnnotationGlyphSource2D.cxx<br>
>> 352:  theta = 2.0 * vtkMath::Pi() / 8.0;<br>
>><br>
>> Libs/MRML/Logic/vtkMRMLSliceLogic.cxx<br>
>> 2128:    double axisMisalignmentDegrees=acos(dotProd)*180.0/vtkMath::Pi();<br>
>><br>
>> Libs/vtkTeem/vtkPreciseHyperStreamline.cxx<br>
>> 591:  vtkFloatingPointType theta=2.0*vtkMath::Pi()/this->NumberOfSides;<br>
>><br>
>> Base/Logic/vtkSlicerGlyphSource2D.cxx<br>
>> 346:  theta = 2.0 * vtkMath::Pi() / 8.0<br>
>><br>
>><br>
>> On Wed, Feb 29, 2012 at 6:41 PM, Jean-Christophe Fillion-Robin<br>
>> <<a href="mailto:jchris.fillionr@kitware.com" target="_blank">jchris.fillionr@kitware.com</a>> wrote:<br>
>>><br>
>>> +1 :)<br>
>>><br>
>>><br>
>>> On Wed, Feb 29, 2012 at 4:57 PM, David Gobbi <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> Hi All,<br>
>>>><br>
>>>> I'm wondering if, for VTK 6, we can make the vtkMath::Pi() return a<br>
>>>> double instead of a float.  Currently, most VTK code is calling<br>
>>>> vtkMath::DoublePi() and, in my opinion, vtkMath::Pi() is more<br>
>>>> readable.<br>
>>>><br>
>>>> Here's my proposal:<br>
>>>><br>
>>>> 1) In VTK 5.10, a vtkMath::FloatPi() method would be added.  Any VTK<br>
>>>> 5.10 code that calls vtkMath::Pi() would be changed to call<br>
>>>> vtkMath::FloatPi() instead.<br>
>>>><br>
>>>> 2) In VTK 6, vtkMath::Pi() would be changed so that it returns double,<br>
>>>> and then all instances of vtkMath::DoublePi() can be changed to<br>
>>>> vtkMath::Pi() to improve readability.<br>
>>>><br>
>>>> If anyone thinks this is a good idea, I can submit a patch for the VTK<br>
>>>> 5.10 changes to gerrit.<br>
>>>><br>
>>>><br>
>>>> To reiterate what I'm proposing, in VTK 5.10, the following methods would<br>
>>>> exist:<br>
>>>><br>
>>>> double vtkMath::DoublePi();<br>
>>>> float vtkMath::Pi();<br>
>>>> float vtkMath::FloatPi();  - new method for single precision<br>
>>>><br>
>>>> In VTK 6.0, the following methods would exist:<br>
>>>><br>
>>>> double vtkMath::DoublePi();<br>
>>>> double vtkMath::Pi();<br>
>>>> float vtkMath::FloatPi();<br>
>>>><br>
>>>>  - David<br>
>>>> _______________________________________________<br>
>>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>>><br>
>>>> Visit other Kitware open-source projects at<br>
>>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>>><br>
>>>> Follow this link to subscribe/unsubscribe:<br>
>>>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> <a href="tel:%2B1%20919%20869%208849" value="+19198698849" target="_blank">+1 919 869 8849</a><br>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> <a href="tel:%2B1%20919%20869%208849" value="+19198698849" target="_blank">+1 919 869 8849</a><br>
>><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br></div>
<br>_______________________________________________<br>
vtk-developers mailing list<br>
<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________<br>