utility
|
cmd_head.c,
count_tokens.c,
cp_file.c,
errmsg.c,
file_opened.c,
find_line.c,
find_string.c,
fn_base.c,
fn_dir.c,
fn_ext.c,
fn_root.c,
gchoice.c,
gdata_line.c,
gdouble.c,
gfield.c,
gint.c,
gntoken.c,
graphics_ok.c,
gstring.c,
lock.c,
lower.c,
mat_multiply.c,
mat_transform.c,
mat_transpose.c,
mv_file.c,
new_extension.c,
nolead.c,
notrail.c,
ordinal.c,
pfield.c,
squish_blanks.c,
test.c,
unlock.c,
upper.c,
utility.h,
utility.make,
valchars.c,
vec_angle.c,
vec_crossprod.c,
vec_diff.c,
vec_dotprod.c,
vec_length.c,
vec_norm.c,
|
|
|
#include "utility.h"
void vec_crossprod(vector1,vector2,vector3)
/*============================================================================*/
/* PURPOSE: CALCULATE THE CROSS PRODUCT OF TWO VECTORS.
/* INPUTS:
/* VECTOR1 (X,Y,Z) TRIPLET.
/* VECTOR2 (X,Y,Z) TRIPLET.
/* OUTPUTS:
/* VECTOR3 (X,Y,Z) TRIPLET EQUAL TO (VECTOR1 CROSS VECTOR2).
/* WRITTEN: M.V.GRIESHABER
/* LAST MODIFICATION: 11 JUNE 1991 MVG
*/
double vector1[3];
double vector2[3];
double vector3[3];
{
/* DETERMINE THE CROSS PRODUCT OF THE VECTORS. */
vector3[0]=vector1[1]*vector2[2] - vector1[2]*vector2[1];
vector3[1]=vector1[2]*vector2[0] - vector1[0]*vector2[2];
vector3[2]=vector1[0]*vector2[1] - vector1[1]*vector2[0];
return;
}
|