Advertisement
Guest User

Untitled

a guest
Sep 15th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. /*
  2. * the device calculates the function
  3. *
  4. * f'(n) = x'
  5. * + v' *n
  6. * + a'/2 *n*(n-1)
  7. * + j'/6 *n*(n-1)*(n-2)
  8. * + s'/24 *n*(n-1)*(n-2)*(n-3)
  9. * + c'/120*n*(n-1)*(n-2)*(n-3)*(n-4)
  10. *
  11. * while we have our parameters in the form
  12. *
  13. * f(n) = x + v*n + a/2*n^2 + j/6*n^3 + s/24*n^4 + c/120*n^5
  14. *
  15. * which is equivalent to
  16. * f(n) = x
  17. * + (v + a/2 + j/6 + s/24 + c/120) * n
  18. * + (a + j + 7/12*s +c/4)/2 * n*(n-1)
  19. * + (j + 3/2*s + 5/4*c)/6 * n*(n-1)*(n-2)
  20. * + (s+2*c)/24 * n*(n-1)*(n-2)*(n-3)
  21. * + c /120* n*(n-1)*(n-2)*(n-3)*(n-4)
  22. *
  23. * so we have
  24. * x' = x
  25. * v' = v + a/2 + j/6 + s/24 + c/120
  26. * a' = a + j + 7/12*s +c/4
  27. * j' = j + 3/2*s + 5/4*c
  28. * s' = s + 2*c
  29. * c' = c
  30. *
  31. * and for the other direction
  32. * x = x'
  33. * v = v' - a'/2 + j'/3 + s'/4 + c'/5
  34. * a = a' - j' + 11/12*s' - 5/6*c'
  35. * j = j' - 3/2*s' + 7/4*c'
  36. * s = s' - 2*c'
  37. * c = c'
  38. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement