equals.lua 1009 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. return {
  2. summary = 'Check if a vector equals another vector.',
  3. description = 'Returns whether a vector is approximately equal to another vector.',
  4. arguments = {
  5. u = {
  6. type = 'Vec2',
  7. description = 'The other vector.'
  8. },
  9. x = {
  10. type = 'number',
  11. description = 'The x component of the other vector.'
  12. },
  13. y = {
  14. type = 'number',
  15. description = 'The y component of the other vector.'
  16. }
  17. },
  18. returns = {
  19. equal = {
  20. type = 'boolean',
  21. description = 'Whether the 2 vectors approximately equal each other.'
  22. },
  23. },
  24. variants = {
  25. {
  26. arguments = { 'u' },
  27. returns = { 'equal' }
  28. },
  29. {
  30. arguments = { 'x', 'y' },
  31. returns = { 'equal' }
  32. }
  33. },
  34. notes = [[
  35. To handle floating point precision issues, this function returns true as long as the squared
  36. distance between the vectors is below `1e-10`.
  37. ]],
  38. related = {
  39. 'Vec3:equals',
  40. 'Vec4:equals',
  41. 'Quat:equals',
  42. 'Mat4:equals'
  43. }
  44. }