summaryrefslogtreecommitdiff
path: root/Examples/tcl/value/example.c
blob: 4ed2fe10ae731ca8e9984b5d363957716eb3d7a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* File : example.c */

#include "example.h"

double dot_product(Vector a, Vector b) {
  return (a.x*b.x + a.y*b.y + a.z*b.z);
}

Vector vector_add(Vector a, Vector b) {
  Vector r;
  r.x = a.x + b.x;
  r.y = a.y + b.y;
  r.z = a.z + b.z;
  return r;
}