dot.h 433 B

1234567891011121314151617181920212223
  1. #ifndef IGL_DOT_H
  2. #define IGL_DOT_H
  3. namespace igl
  4. {
  5. // Computes out = dot(a,b)
  6. // Inputs:
  7. // a left 3d vector
  8. // b right 3d vector
  9. // Returns scalar dot product
  10. inline double dot(
  11. const double *a,
  12. const double *b);
  13. }
  14. // Implementation
  15. // http://www.antisphere.com/Wiki/tools:anttweakbar
  16. inline double igl::dot(
  17. const double *a,
  18. const double *b)
  19. {
  20. return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
  21. }
  22. #endif