[vtk-developers] DoublePi proposal

David Gobbi david.gobbi at gmail.com
Wed Feb 29 16:57:09 EST 2012


Hi All,

I'm wondering if, for VTK 6, we can make the vtkMath::Pi() return a
double instead of a float.  Currently, most VTK code is calling
vtkMath::DoublePi() and, in my opinion, vtkMath::Pi() is more
readable.

Here's my proposal:

1) In VTK 5.10, a vtkMath::FloatPi() method would be added.  Any VTK
5.10 code that calls vtkMath::Pi() would be changed to call
vtkMath::FloatPi() instead.

2) In VTK 6, vtkMath::Pi() would be changed so that it returns double,
and then all instances of vtkMath::DoublePi() can be changed to
vtkMath::Pi() to improve readability.

If anyone thinks this is a good idea, I can submit a patch for the VTK
5.10 changes to gerrit.


To reiterate what I'm proposing, in VTK 5.10, the following methods would exist:

double vtkMath::DoublePi();
float vtkMath::Pi();
float vtkMath::FloatPi();  - new method for single precision

In VTK 6.0, the following methods would exist:

double vtkMath::DoublePi();
double vtkMath::Pi();
float vtkMath::FloatPi();

 - David



More information about the vtk-developers mailing list