IMP  2.0.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 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
12 p1= IMP.Particle(m)
13 # add slots for the coordinates, but leave them uninitialized
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)