1 """@namespace IMP.EMageFit.imp_general.movement
2 Utility functions to handle movement.
13 """Apply a random transformation to the rigid body and change
14 the reference frame"""
20 ref = rb.get_reference_frame()
21 Tr = ref.get_transformation_to()
29 If fn_write is different from False, write to file
32 t = T.get_translation()
34 coords = [p.get_coordinates()
for p
in xyz1]
35 newvs = [R.get_rotated(v) + t
for v
in coords]
36 for i
in range(len(newvs)):
37 xyz1[i].set_coordinates(newvs[i])
44 Return a random transformation
45 @param max_distance Maximum translation allowed
46 @param max_angle Maximum rotation angle allowed
47 @param seed If specified, seed for random number generator
55 phi = random.uniform(-max_angle, max_angle)
56 theta = random.uniform(-max_angle, max_angle)
57 psi = random.uniform(-max_angle, max_angle)
58 trans_x = random.uniform(-max_distance, max_distance)
59 trans_y = random.uniform(-max_distance, max_distance)
60 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)