1 """@namespace IMP.EMageFit.imp_general.movement
2 Utility functions to handle movement.
15 Apply a random transformation to the rigid body and change the reference
23 ref = rb.get_reference_frame()
24 Tr = ref.get_transformation_to()
32 If fn_write is different from False, write to file
35 t = T.get_translation()
37 coords = [p.get_coordinates()
for p
in xyz1]
38 newvs = [R.get_rotated(v) + t
for v
in coords]
39 for i
in range(len(newvs)):
40 xyz1[i].set_coordinates(newvs[i])
47 Return a random transformation
48 @param max_distance Maximum translation allowed
49 @param max_angle Maximum rotation angle allowed
50 @param seed If specified, seed for random number generator
58 phi = random.uniform(-max_angle, max_angle)
59 theta = random.uniform(-max_angle, max_angle)
60 psi = random.uniform(-max_angle, max_angle)
61 trans_x = random.uniform(-max_distance, max_distance)
62 trans_y = random.uniform(-max_distance, max_distance)
63 trans_z = random.uniform(-max_distance, max_distance)
def apply_random_transform
Apply a random transformation to the rigid body and change the reference frame.
Rotation3D get_random_rotation_3d(const Rotation3D ¢er, double distance)
Pick a rotation at random near the provided one.
void write_pdb(const Selection &mhd, TextOutput out, unsigned int model=1)
Vector3D get_random_vector_in(const Cylinder3D &c)
Generate a random vector in a cylinder with uniform density.
def apply_transformation_to_hierarchy
If fn_write is different from False, write to file.
Rotation3D get_rotation_from_fixed_zyz(double Rot, double Tilt, double Psi)
Generate a rotation object from Euler Angles.
A decorator for a particle with x,y,z coordinates.
Transformation3D compose(const Transformation3D &a, const Transformation3D &b)
Compose two transformations.
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...
def get_random_transformation
Return a random transformation.
Functionality for loading, creating, manipulating and scoring atomic structures.
Hierarchies get_leaves(const Selection &h)