angle.lua 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. return {
  2. summary = 'Get the angle to another vector.',
  3. description = 'Returns the angle between vectors.',
  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. angle = {
  20. type = 'number',
  21. description = 'The angle to the other vector, in radians.'
  22. },
  23. },
  24. variants = {
  25. {
  26. arguments = { 'u' },
  27. returns = { 'angle' }
  28. },
  29. {
  30. arguments = { 'x', 'y' },
  31. returns = { 'angle' }
  32. }
  33. },
  34. notes = [[
  35. If any of the two vectors have a length of zero, the angle between them is not well defined. In
  36. this case the function returns `math.pi / 2`.
  37. ]],
  38. related = {
  39. 'Vec2:distance',
  40. 'Vec2:length'
  41. }
  42. }