Skip to content

Commit 1db029e

Browse files
committed
BUG: Fix incorrect calculation in CylinderOps
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent bd02eee commit 1db029e

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

Source/SIMPLib/Geometry/ShapeOps/CylinderAOps.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ float CylinderAOps::radcur1(QMap<ArgName, float> args)
5959
float covera = args[C_OverA];
6060

6161
// the equation for volume for an A cylinder is pi*b*c*h where b and c are semi axis lengths, but
62-
// h is a full axis length - meaning h = 2a. However, since our aspect ratios relate semi axis lengths, the 2.0
63-
// factor can be ingored in this part
64-
radcur1 = static_cast<float>((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
62+
// h is a full axis length - meaning h = 2a.
63+
radcur1 = static_cast<float>((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
6564
radcur1 = powf(radcur1, 0.333333333333f);
6665
return radcur1;
6766
}

Source/SIMPLib/Geometry/ShapeOps/CylinderBOps.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ float CylinderBOps::radcur1(QMap<ArgName, float> args)
5959
float covera = args[C_OverA];
6060

6161
// the equation for volume for a B cylinder is pi*a*c*h where a and c are semi axis lengths, but
62-
// h is a full axis length - meaning h = 2b. However, since our aspect ratios relate semi axis lengths, the 2.0
63-
// factor can be ingored in this part
64-
radcur1 = static_cast<float>((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
62+
// h is a full axis length - meaning h = 2b.
63+
radcur1 = static_cast<float>((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
6564
radcur1 = powf(radcur1, 0.333333333333f);
6665
return radcur1;
6766
}

Source/SIMPLib/Geometry/ShapeOps/CylinderCOps.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ float CylinderCOps::radcur1(QMap<ArgName, float> args)
5959
float covera = args[C_OverA];
6060

6161
// the equation for volume for a C cylinder is pi*a*b*h where a and b are semi axis lengths, but
62-
// h is a full axis length - meaning h = 2c. However, since our aspect ratios relate semi axis lengths, the 2.0
63-
// factor can be ingored in this part
64-
radcur1 = static_cast<float>((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
62+
// h is a full axis length - meaning h = 2c.
63+
radcur1 = static_cast<float>((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
6564
radcur1 = powf(radcur1, 0.333333333333f);
6665
return radcur1;
6766
}

0 commit comments

Comments
 (0)