IMP logo
IMP Reference Guide  develop.78018a392b,2024/05/07
The Integrative Modeling Platform
randomize.py
1 # Python files placed in this src directory are automatically added to
2 # the IMP.example module, each as a submodule.
3 #
4 # i.e. the function below can be accessed as
5 # IMP.example.randomize.randomize_particle().
6 #
7 # It is recommended to add this set of __future__ imports so that your
8 # code works similarly in Python 2 and Python 3.
9 
10 from __future__ import print_function, division, absolute_import
11 
12 import IMP.core
13 import IMP.algebra
14 
15 def randomize_particle(p):
16  d = IMP.core.XYZ(p)
17  d.set_coordinates(IMP.algebra.get_random_vector_in(
18  IMP.algebra.get_unit_bounding_box_3d()))
Vector3D get_random_vector_in(const Cylinder3D &c)
Generate a random vector in a cylinder with uniform density.
A decorator for a particle with x,y,z coordinates.
Definition: XYZ.h:30
Basic functionality that is expected to be used by a wide variety of IMP users.
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...