angle.lua 1.0 KB

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