dot.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. return {
  2. summary = 'Get the dot product with another vector.',
  3. description = 'Returns the dot product between this vector and another one.',
  4. arguments = {
  5. u = {
  6. type = 'Vec4',
  7. description = 'The vector to compute the dot product with.'
  8. },
  9. x = {
  10. type = 'number',
  11. description = 'A value of x component to compute the dot product with.'
  12. },
  13. y = {
  14. type = 'number',
  15. description = 'A value of y component to compute the dot product with.'
  16. },
  17. z = {
  18. type = 'number',
  19. description = 'A value of z component to compute the dot product with.'
  20. },
  21. w = {
  22. type = 'number',
  23. description = 'A value of w component to compute the dot product with.'
  24. }
  25. },
  26. returns = {
  27. dot = {
  28. type = 'number',
  29. description = 'The dot product between `v` and `u`.'
  30. }
  31. },
  32. variants = {
  33. {
  34. arguments = { 'u' },
  35. returns = { 'dot' }
  36. },
  37. {
  38. arguments = { 'x', 'y', 'z', 'w' },
  39. returns = { 'dot' }
  40. }
  41. },
  42. notes = [[
  43. This is computed as:
  44. dot = v.x * u.x + v.y * u.y + v.z * u.z + v.w * u.w
  45. The vectors are not normalized before computing the dot product.
  46. ]]
  47. }