IMP  2.0.1
The Integrative Modeling Platform
core/XYZR_Decorator.py

This is a simple example using the XYZRDecorator to set the coordinates and radius of a particle and compute distances between the resulting spheres.

1 ## \example core/XYZR_Decorator.py
2 ## This is a simple example using the XYZRDecorator to set the coordinates and radius of a particle and compute distances between the resulting spheres.
3 
4 import IMP
5 import IMP.core
6 import IMP.algebra
7 
8 m= IMP.Model()
9 p0= IMP.Particle(m)
11  1.0))
12 p1= IMP.Particle(m)
14 d1.set_coordinates(IMP.algebra.Vector3D(3,4,5))
15 d1.set_radius(2.0)
16 
17 print IMP.core.get_distance(d0, d1)
18 
19 # use them as XYZ particles
22 
23 # distance without radii
24 print IMP.core.get_distance(xd0, xd1)