/trunk/Examples/php/value/example.c
C | 13 lines | 9 code | 3 blank | 1 comment | 0 complexity | 8ea0d3f6cdf353f5527c115d947b8610 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- /* 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;
- }