PageRenderTime 17ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
C | 15 lines | 11 code | 3 blank | 1 comment | 0 complexity | 670fcd025a3c2903e92b066aff521adf MD5 | raw file
 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}