Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
qbox
qbox-public
Commits
949813b7
Commit
949813b7
authored
Jun 05, 2016
by
Francois Gygi
Browse files
simplified implementation
git-svn-id:
http://qboxcode.org/svn/qb/trunk@1832
cba15fb0-1239-40c8-b417-11db7ca47a34
parent
bc3c46e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
util/qbox_distance.py
View file @
949813b7
...
...
@@ -44,19 +44,19 @@ class QboxOutputHandler(xml.sax.handler.ContentHandler):
def
endElement
(
self
,
name
):
if
name
==
"atomset"
:
self
.
pos1
=
self
.
buffer1
.
split
()
self
.
pos2
=
self
.
buffer2
.
split
()
self
.
r1x
=
float
(
self
.
pos1
[
0
])
self
.
r1y
=
float
(
self
.
pos1
[
1
])
self
.
r1z
=
float
(
self
.
pos1
[
2
])
self
.
r2x
=
float
(
self
.
pos2
[
0
])
self
.
r2y
=
float
(
self
.
pos2
[
1
])
self
.
r2z
=
float
(
self
.
pos2
[
2
])
pos1
=
self
.
buffer1
.
split
()
pos2
=
self
.
buffer2
.
split
()
r1x
=
float
(
pos1
[
0
])
r1y
=
float
(
pos1
[
1
])
r1z
=
float
(
pos1
[
2
])
r2x
=
float
(
pos2
[
0
])
r2y
=
float
(
pos2
[
1
])
r2z
=
float
(
pos2
[
2
])
#print "r1: ",self.r1x,self.r1y,self.r1z
#print "r2: ",self.r2x,self.r2y,self.r2z
print
'%.4f'
%
math
.
sqrt
((
self
.
r1x
-
self
.
r2x
)
**
2
+
(
self
.
r1y
-
self
.
r2y
)
**
2
+
(
self
.
r1z
-
self
.
r2z
)
**
2
)
print
'%.4f'
%
math
.
sqrt
((
r1x
-
r2x
)
**
2
+
(
r1y
-
r2y
)
**
2
+
(
r1z
-
r2z
)
**
2
)
elif
name
==
"position"
:
self
.
readPos1
=
0
self
.
readPos2
=
0
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment