   }
   
   // 引数で与えた角度の中に含まれるスリットのindexを配列にして返す
-  fileprivate func slitIndexInRange(_ prev: Double, current: Double) -> Array<Int> {
-    if prev == current {
+  private func slitIndexInRange(_ current: Double) -> Array<Int> {
+    if prevDeg == current {
       return []
     }
     
-    let _prev = restrict(prev)
+    let _prev = restrict(prevDeg)
     let _current = restrict(current)
     let _min = min(_prev, _current)
     let _max = max(_prev, _current)

  func updateRotation(_ radian: Double) {
    
    let currentDeg = radiansToDegrees(radian)
    let variation = getVariation(prevDeg, current: currentDeg)
    
    arrow.transform = CGAffineTransform(rotationAngle: CGFloat(radian))
    

  // 変化量を計算（359°->2°などに変化した時に正しく回転方向を算出）
  // [left wheel]  forward: plus, back: minus
  // [right wheel] forward: minus, back: plus
  private func getVariation(_ current: Double) -> Float {
    let diff = abs(prevDeg - current)
    
    if 180 < diff {
      if 180 < prevDeg {
        return Float((360 - prevDeg) + current)
      }
      else {
        return Float((360.0 - current) + prevDeg)
      }
    }
    return Float(prevDeg - current)
  }
}

