angle.lua 1.1 KB

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