Quote:
Originally Posted by jgannon
Can you explain how that would work? I'm reasonably confident that you would get exactly the same result for any given value of arm_pos (discounting any overflow issues).
|
They're just trying to maximize the value in the numerator, prior to doing the division, which will truncate the decimals back to an integer. The larger the numerator, the less of a truncation error.
Using ArmPosition = 501, here's what you'd get with all 3 methods:
First Method:
wrist_pos = -11/5*arm_pos + 1670 = (-2)*501+1670 =
668
2nd method:
wrist_pos = -11*arm_pos/5 + 1670 = (-5511)/5 + 1670 = -1102+1670=
568
3rd method:
wrist_pos = (-11*arm_pos + 1670*5 )/ 5 = 2850/5 = 567.8 =
567