randomNormal.lua 980 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. sigma = {
  10. type = 'number',
  11. default = '1',
  12. description = [[
  13. The standard deviation of the distribution. This can be thought of how "wide" the range of
  14. numbers is or how much variability there is.
  15. ]]
  16. },
  17. mu = {
  18. type = 'number',
  19. default = '0',
  20. description = 'The average value returned.'
  21. }
  22. },
  23. returns = {
  24. x = {
  25. type = 'number',
  26. description = 'A normally distributed pseudo-random number.'
  27. }
  28. },
  29. variants = {
  30. {
  31. arguments = { 'sigma', 'mu' },
  32. returns = { 'x' }
  33. }
  34. },
  35. related = {
  36. 'lovr.math.random',
  37. 'RandomGenerator'
  38. }
  39. }