r is confusing, use ab instead

This commit is contained in:
Matt Terry
2013-08-17 11:11:23 -07:00
parent 9fe1e26583
commit d86b624d43
+3 -3
View File
@@ -320,11 +320,11 @@ def get_dH2(lab1, lab2):
dH = sqrt(term)
However, this has poor roundoff properties when a or b is dominant.
Instead, r is a vector with elements a and b. The same dH term can be
Instead, ab is a vector with elements a and b. The same dH term can be
re-written as:
|r1-r2|**2 - (|r1| - |r2|)**2
|ab1-ab2|**2 - (|ab1| - |ab2|)**2
and then simplified to:
2*|r1|*|r2| - 2*dot(r1, r2)
2*|ab1|*|ab2| - 2*dot(ab1, ab2)
"""
lab1 = np.asarray(lab1)
lab2 = np.asarray(lab2)