IMP
2.0.1
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
XYZ_Decorator.py
1
## \example core/XYZ_Decorator.py
2
## This is a simple example using the XYZDecorator to set the coordinates of some particles and compute the distance between them.
3
4
import
IMP
5
import
IMP.core
6
import
IMP.algebra
7
8
m=
IMP.Model
()
9
p0=
IMP.Particle
(m)
10
# add x,y,z coordinates to the particle
11
d0=
IMP.core.XYZ.setup_particle
(p0,
IMP.algebra.Vector3D
(0,1,2))
12
p1=
IMP.Particle
(m)
13
# add slots for the coordinates, but leave them uninitialized
14
d1=
IMP.core.XYZ.setup_particle
(p1)
15
# set the coordinate values
16
d1.set_coordinates(
IMP.algebra.Vector3D
(3,4,5))
17
18
# return the distance between the two points described by the decorated
19
# particles
20
print
IMP.core.get_distance
(d0, d1)