9 template <
typename T>
int sgn(T val) {
10 return (T(0) < val) - (val < T(0));
22 for(
int i = 0; i < 3; i++)
34 template <
typename T>
void normalize3d(T normalized[3], T
const toNormalize[3] )
36 T normalization =
length3d(toNormalize);
37 for(
int i = 0; i < 3; i++)
39 normalized[i] = toNormalize[i]/normalization;
48 template <
typename T> T
innerProduct(T
const one[3], T
const two[3])
51 for(
int i = 0; i < 3; i++)
58 #define radToDeg(x) (180.0*x/M_PI) 59 #define degToRad(x) (M_PI*x/180.0) void normalize3d(T normalized[3], T const toNormalize[3])
T innerProduct(T const one[3], T const two[3])