2 ======================================================================
5 Basic vector and matrix functions.
8 ====================================================================== */
13 float dot( float a[], float b[] )
15 return a[ 0 ] * b[ 0 ] + a[ 1 ] * b[ 1 ] + a[ 2 ] * b[ 2 ];
19 void cross( float a[], float b[], float c[] )
21 c[ 0 ] = a[ 1 ] * b[ 2 ] - a[ 2 ] * b[ 1 ];
22 c[ 1 ] = a[ 2 ] * b[ 0 ] - a[ 0 ] * b[ 2 ];
23 c[ 2 ] = a[ 0 ] * b[ 1 ] - a[ 1 ] * b[ 0 ];
27 void normalize( float v[] )
31 r = ( float ) sqrt( dot( v, v ));