GLYLIB
0.3.0b
|
00001 // Function written by B. Lachele Foley, 2007 00002 #include <mylib.h> 00003 #include <molecules.h> 00004 /* this multiplies a vector by a scalar (and sets d, too) */ 00005 vectormag_3D scalarmult_vec(vectormag_3D v,double s){ 00006 vectormag_3D nv; 00007 00008 nv.i=v.i*s; 00009 nv.j=v.j*s; 00010 nv.k=v.k*s; 00011 00012 // don't trust the d in nv 00013 nv.d=sqrt(nv.i*nv.i+nv.j*nv.j+nv.k*nv.k); 00014 00015 return nv; 00016 }