-2 java
就目前而言,这是我正在尝试的代码:
if(gear.isLeftHand())
helix = (gear.getParentPair().beta());
else if (gear.isRightHand())
helix = Math.PI - (gear.getParentPair().beta());
else if (gear.isSpur())
helix = 0;
else
helix = 0;
double stepAng = (thickness /radius) * helix;
Run Code Online (Sandbox Code Playgroud)
但是它不起作用,这是因为'helix无法解析为变量'
我试图获得stepAng的值,这取决于初始角度是左手还是右手,因此"螺旋"的值将根据此方向根据不同的公式计算.
非常感激任何的帮助.
您需要实际声明helix,如果将其初始化为0,则可以取消两个表达式(我假设它是一个double给定的引用Math.PI):
double helix = 0;
if (gear.isLeftHand()) {
helix = (gear.getParentPair().beta());
} else if (gear.isRightHand()) {
helix = Math.PI - (gear.getParentPair().beta());
}
double stepAng = (thickness / radius) * helix;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
108 次 |
| 最近记录: |