randomNormal.lua 929 B

123456789101112131415161718192021222324252627282930313233343536
  1. return {
  2. tag = 'random',
  3. summary = 'Get a random number from a normal distribution.',
  4. description = [[
  5. Returns a pseudo-random number from a normal distribution (a bell curve). You can control the
  6. center of the bell curve (the mean value) and the overall width (sigma, or standard deviation).
  7. ]],
  8. arguments = {
  9. {
  10. name = 'sigma',
  11. type = 'number',
  12. default = '1',
  13. description = [[
  14. The standard deviation of the distribution. This can be thought of how "wide" the range of
  15. numbers is or how much variability there is.
  16. ]]
  17. },
  18. {
  19. name = 'mu',
  20. type = 'number',
  21. default = '0',
  22. description = 'The average value returned.'
  23. }
  24. },
  25. returns = {
  26. {
  27. name = 'x',
  28. type = 'number',
  29. description = 'A normally distributed pseudo-random number.'
  30. }
  31. },
  32. related = {
  33. 'lovr.math.random',
  34. 'RandomGenerator'
  35. }
  36. }