PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/perl5/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
 3#include "example.h"
 4
 5double dot_product(Vector a, Vector b) {
 6  return (a.x*b.x + a.y*b.y + a.z*b.z);
 7}
 8
 9Vector vector_add(Vector a, Vector b) {
10  Vector r;
11  r.x = a.x + b.x;
12  r.y = a.y + b.y;
13  r.z = a.z + b.z;
14  return r;
15}