[Tutor] Euclidean Distances between Atoms in a Molecule.

Alan Gauld alan.gauld at yahoo.co.uk
Sun Apr 2 19:02:51 EDT 2017


On 02/04/17 18:41, Stephen P. Molnar wrote:
> I am trying to port a program that I wrote in FORTRAN twenty years ago 
> into Python 3 and am having a hard time trying to calculate the 
> Euclidean distance between each atom in the molecule and every other 
> atom in the molecule.

Sounds highly specialized. Remember this is a general language
tutor group and very few of us even know what Euclidean
distances between atoms might mean let alone how to calculate
them.

You need to either ask on a more technical group (such as
the SciPy forum maybe?) or provide the context so we know
what you are talking about. Its easy for experts to forget
just how little the rest of humanity knows about their area.


>        MASS         X         Y         Z
> 0   12.011 -3.265636  0.198894  0.090858
> 1   12.011 -1.307161  1.522212  1.003463
> 2   12.011  1.213336  0.948208 -0.033373
> 3   14.007  3.238650  1.041523  1.301322
> 4   12.011 -5.954489  0.650878  0.803379
> 
> What I need for further calculation is a matrix of the Euclidean 
> distances between the atoms.
> 
> So far in searching the Python literature I have only managed 
> to confuse myself

Where are you searching and what for? You are very unlikely
to find any references to Euclidean maths in the standard
library of docs. You might find them in the SciPy forums.

What have you tried? How did it fail?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list