IMP  2.2.1
The Integrative Modeling Platform
XYZ_Decorator.py
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)
static XYZ setup_particle(kernel::Model *m, ParticleIndex pi)
Definition: XYZ.h:51
double get_distance(XYZR a, XYZR b)
Compute the sphere distance between a and b.
Definition: XYZR.h:88
See IMP.core for more information.
See IMP.algebra for more information.
VectorD< 3 > Vector3D
Definition: VectorD.h:395
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72