PageRenderTime 36ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/tcl/value/example.c

#
C | 15 lines | 11 code | 3 blank | 1 comment | 0 complexity | 670fcd025a3c2903e92b066aff521adf MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* File : example.c */
  2. #include "example.h"
  3. double dot_product(Vector a, Vector b) {
  4. return (a.x*b.x + a.y*b.y + a.z*b.z);
  5. }
  6. Vector vector_add(Vector a, Vector b) {
  7. Vector r;
  8. r.x = a.x + b.x;
  9. r.y = a.y + b.y;
  10. r.z = a.z + b.z;
  11. return r;
  12. }