Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bill Lorensen
VTK
Commits
05b9f407
Commit
05b9f407
authored
Feb 29, 2012
by
Kyle Lutz
Committed by
Code Review
Feb 29, 2012
Browse files
Merge topic 'pi-precision' into master
fa50ef90
Fix precision issues when using vtkMath::Pi()
parents
8bd0d55d
fa50ef90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Common/vtkCylindricalTransform.cxx
View file @
05b9f407
...
...
@@ -15,7 +15,7 @@
#include
"vtkCylindricalTransform.h"
#include
"vtkObjectFactory.h"
#include
"vtkMath.h"
#include
<math
.h
>
#include
<
c
math>
#include
<stdlib.h>
vtkStandardNewMacro
(
vtkCylindricalTransform
);
...
...
@@ -102,7 +102,7 @@ void vtkRectangularToCylindrical(const T inPoint[3], T outPoint[3])
else
{
// Change range to [0, 2*Pi], otherwise the same as atan2(y, x)
outPoint
[
1
]
=
static_cast
<
T
>
(
vtkMath
::
Pi
()
+
atan2
(
-
y
,
-
x
)
)
;
outPoint
[
1
]
=
T
(
vtkMath
::
Double
Pi
()
)
+
atan2
(
-
y
,
-
x
);
}
outPoint
[
2
]
=
z
;
}
...
...
Common/vtkMath.cxx
View file @
05b9f407
...
...
@@ -2973,7 +2973,7 @@ int vtkMath::PointIsWithinBounds(double point[3], double bounds[6], double delta
//----------------------------------------------------------------------------
double
vtkMath
::
GaussianAmplitude
(
const
double
variance
,
const
double
distanceFromMean
)
{
return
1.
/
(
sqrt
(
2.
*
vtkMath
::
Pi
()
*
variance
))
*
exp
(
-
(
pow
(
distanceFromMean
,
2
))
/
(
2.
*
variance
));
return
1.
/
(
sqrt
(
2.
*
vtkMath
::
Double
Pi
()
*
variance
))
*
exp
(
-
(
pow
(
distanceFromMean
,
2
))
/
(
2.
*
variance
));
}
//----------------------------------------------------------------------------
...
...
Common/vtkSphericalTransform.cxx
View file @
05b9f407
...
...
@@ -15,7 +15,7 @@
#include
"vtkSphericalTransform.h"
#include
"vtkObjectFactory.h"
#include
"vtkMath.h"
#include
<math
.h
>
#include
<
c
math>
#include
<stdlib.h>
vtkStandardNewMacro
(
vtkSphericalTransform
);
...
...
@@ -112,7 +112,7 @@ void vtkRectangularToSpherical(const T inPoint[3], T outPoint[3])
else
{
// Change range to [0, 2*Pi], otherwise the same as atan2(y, x)
outPoint
[
2
]
=
vtkMath
::
Pi
()
+
atan2
(
-
y
,
-
x
);
outPoint
[
2
]
=
T
(
vtkMath
::
Double
Pi
()
)
+
atan2
(
-
y
,
-
x
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment