From 76cd15aa8de3f6c78960314ed5e40849be8fd081 Mon Sep 17 00:00:00 2001 From: taw27 Date: Mon, 26 Feb 2007 13:11:22 +0000 Subject: Honour voltage from MRC header if present git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@11 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/utils.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index ce7c7f3..4055676 100644 --- a/src/utils.c +++ b/src/utils.c @@ -42,3 +42,15 @@ double angle_between(double x1, double y1, double z1, double x2, double y2, doub return ((acos((x1*x2 + y1*y2 + z1*z2) / (mod1*mod2)))/M_PI) * 180; } + +/* Wavelength of an electron (in m) given accelerating potential (in V) */ +double lambda(double V) { + + double m = 9.110E-31; + double h = 6.625E-34; + double e = 1.60E-19; + double c = 2.998E8; + + return h / sqrt(2*m*e*V*(1+(e*V / 2*m*c*c))); + +} -- cgit v1.2.3