dot.lua 932 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 = 'Vec2',
  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. },
  18. returns = {
  19. dot = {
  20. type = 'number',
  21. description = 'The dot product between `v` and `u`.'
  22. }
  23. },
  24. variants = {
  25. {
  26. arguments = { 'u' },
  27. returns = { 'dot' }
  28. },
  29. {
  30. arguments = { 'x', 'y' },
  31. returns = { 'dot' }
  32. }
  33. },
  34. notes = [[
  35. This is computed as:
  36. dot = v.x * u.x + v.y * u.y
  37. The vectors are not normalized before computing the dot product.
  38. ]]
  39. }