【发布时间】:2017-06-19 04:18:25
【问题描述】:
给定方程-> (index+rotation)%rot=f;如果我知道 f , rotation , rot 的值 计算指数的公式是什么。我的数学不太好,但我想知道在我的编程中计算指数。
【问题讨论】:
-
rot*k+f - rotation,这里k是一个非零整数。
给定方程-> (index+rotation)%rot=f;如果我知道 f , rotation , rot 的值 计算指数的公式是什么。我的数学不太好,但我想知道在我的编程中计算指数。
【问题讨论】:
rot*k+f - rotation,这里k是一个非零整数。
(索引 + 旋转)%rot = f
意思
index + rotation = rot*k + f, k is an integer (.., -2, -1, 0, 1, 2,..)
所以
index = rot*k + f - rotation, k: integer
如果你想拥有index > 0,请务必选择k > (rotation - f) / rot
【讨论】: