PageRenderTime 45ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/php/value/example.c

#
C | 13 lines | 9 code | 3 blank | 1 comment | 0 complexity | 8ea0d3f6cdf353f5527c115d947b8610 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. void vector_add(Vector a, Vector b, Vector* result) {
  7. result->x = a.x + b.x;
  8. result->y = a.y + b.y;
  9. result->z = a.z + b.z;
  10. }