MolSSI-Education / python_scripting_cms

Python Data and Scripting course for computational chemists
https://molssi-education.github.io/python_scripting_cms
Other
83 stars 33 forks source link

Geometry analysis - distance calculation #33

Closed janash closed 5 years ago

janash commented 5 years ago

We never introduce ** syntax for raising to a power, but use it in a distance calculation exercise.

janash commented 5 years ago

For the solution, we should separate out the different calculations, as it seemed to help students understand what was going on at GLRM.

ie, in the for loop:

x_distance = atomA_coords[0] - atomB_coords[0]
y_distance = atomA_coords[1] - atomB_coords[1]
z_distance = atomA_coords[2] - atomB_coords[2]

distance = numpy.sqrt(x_distance**2 + y_distance**2 + z_distance**2)
janash commented 5 years ago

Addressed by #37