cross.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_CROSS_H
  9. #define IGL_CROSS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Computes out = cross(a,b)
  15. // Inputs:
  16. // a left 3d vector
  17. // b right 3d vector
  18. // Outputs:
  19. // out result 3d vector
  20. IGL_INLINE void cross( const double *a, const double *b, double *out);
  21. // Computes C = cross(A,B,2);
  22. //
  23. // Inputs:
  24. // A #A by 3 list of row-vectors
  25. // B #A by 3 list of row-vectors
  26. // Outputs:
  27. // C #A by 3 list of row-vectors
  28. template <
  29. typename DerivedA,
  30. typename DerivedB,
  31. typename DerivedC>
  32. IGL_INLINE void cross(
  33. const Eigen::PlainObjectBase<DerivedA> & A,
  34. const Eigen::PlainObjectBase<DerivedB> & B,
  35. Eigen::PlainObjectBase<DerivedC> & C);
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. # include "cross.cpp"
  39. #endif
  40. #endif