IMP  2.2.0
The Integrative Modeling Platform
core/XYZ_Decorator.py

This is a simple example using the XYZDecorator to set the coordinates of some particles and compute the distance between them.

1 ## \example core/XYZ_Decorator.py
2 # This is a simple example using the XYZDecorator to set the coordinates
3 # of some particles and compute the distance between them.
4 
5 import IMP
6 import IMP.core
7 import IMP.algebra
8 
10 p0 = m.add_particle("xyz0")
11 # add x,y,z coordinates to the particle
13 p1 = m.add_particle("xyz1")
14 # add slots for the coordinates, but leave them uninitialized
16 # set the coordinate values
17 d1.set_coordinates(IMP.algebra.Vector3D(3, 4, 5))
18 
19 # return the distance between the two points described by the decorated
20 # particles
21 print IMP.core.get_distance(d0, d1)