randomNormal.lua 975 B

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