/* == veclib3d.c == */ void vl_idmat3( double mtx[3][3]); /* Scale a 3d vector */ void vl_scale3( double fact, double *v1, double *v2); void vl_reverse3( double *v1, double *v2); void vl_copy3( double *vin, double *vout); /* Find the inner product of two input vectors */ double vl_dot3( double *v1, /* Left input vector */ double *v2); /* Return length of a 3d vector */ double vl_length3( double *v1); /* Compute the difference of two vectors */ /* v3 = v2 - v1 */ void vl_diff3( double *v1, /* -- input vector */ double *v2, /* -- input vector */ double *v3); /* Compute the sum of two vectors */ void vl_sum3( double *v1, /* Left input vector */ double *v2, /* Right input vector */ double *v3); /* Construct a unit length vector in the required direction */ void vl_unitvec3( double *v1, /* Input vector */ double *v2); /* Compute the outer product of two input vectors */ void vl_cross3( double *v1, /* Left input vector */ double *v2, /* Right input vector */ double *v3); /* 3 x 3 matrix multiplier */ void vl_matmul3( double x[3][3], /* Left input matrix */ double y[3][3], /* Right input matrix */ double z[3][3]); /* n x n matrix transpose */ void vl_xpose3( double x[3][3], /* Left input matrix */ double z[3][3]); /* Print the contents of a transform matrix */ void vl_matprn3( char *label, double mat[3][3]); /* Print the contents of a vector */ void vl_vecprn3( char *label, double vec[3]); /* Create a matrix to rotate a vector around the y axis */ void vl_xzrot3( double matrix[3][3], /* Matrix to be filled in */ double theta); /* Create a matrix to rotate a vector around the x axis */ void vl_yzrot3( double matrix[3][3], /* Matrix to be filled in */ double theta); /* Create a matrix to rotate a vector around the z axis */ void vl_xyrot3( double matrix[3][3], /* Matrix to be filled in */ double theta); /* Perform a linear transform in four dimensional space */ /* By applying a 3 x 3 matrix to a 3 x 1 column vector */ void vl_xform3d( double y[3][3], /* Xform matrix */ double x[3], /* Input vector */ double z[3]); /* Perform a linear transform in four dimensional space */ /* By applying a 3 x 3 matrix to a 3 x 1 column vector */ void vl_xfnadd3( double y[3][3], /* Xform matrix */ double x[3], /* Input vector */ double z[3]); void vl_reflect3( double *in, double *norm, double *out);