PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 4ms 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
 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
 9void vector_add(Vector a, Vector b, Vector* result) {
10  result->x = a.x + b.x;
11  result->y = a.y + b.y;
12  result->z = a.z + b.z;
13}