length.lua 480 B

1234567891011121314151617181920212223242526
  1. return {
  2. summary = 'Get the length of the vector.',
  3. description = 'Returns the length of the vector.',
  4. arguments = {},
  5. returns = {
  6. length = {
  7. type = 'number',
  8. description = 'The length of the vector.'
  9. }
  10. },
  11. variants = {
  12. {
  13. arguments = {},
  14. returns = { 'length' }
  15. }
  16. },
  17. notes = [[
  18. The length is equivalent to this:
  19. math.sqrt(v.x * v.x + v.y * v.y)
  20. ]],
  21. related = {
  22. 'Vec2:normalize',
  23. 'Vec2:distance'
  24. }
  25. }