GLYLIB  0.3.0b
coord_to_vec.c
Go to the documentation of this file.
00001 // Function written by B. Lachele Foley, 2007
00002 #include <mylib.h>
00003 #include <molecules.h>
00004 //#include "../inc/mylib.h"
00005 //#include "../inc/molecules.h"
00006 /* this turns a coordinate set into a vector */
00007 vectormag_3D coord_to_vec(coord_3D c){
00008 vectormag_3D nv;
00009 
00010 nv.i=c.i;
00011 nv.j=c.j;
00012 nv.k=c.k;
00013 // don't trust entry in 'd' -- normalize now to be certain
00014 nv.d=sqrt(nv.i*nv.i+nv.j*nv.j+nv.k*nv.k);
00015 
00016 return nv;
00017 }
00018 
00019 /* this turns a vector into a coordinate set */
00020 coord_3D vec_to_coord(vectormag_3D v){
00021 coord_3D nc;
00022 
00023 nc.i=v.i;
00024 nc.j=v.j;
00025 nc.k=v.k;
00026 
00027 return nc;
00028 }
 All Classes Files Functions Variables Typedefs Defines