aboutsummaryrefslogtreecommitdiff
path: root/Examples/php5/value/example.c
blob: 3c402a2141eb48f52d96669bd3d45254b0f6ce0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* 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);
}

void vector_add(Vector a, Vector b, Vector* result) {
  result->x = a.x + b.x;
  result->y = a.y + b.y;
  result->z = a.z + b.z;
}