Skip to content

Operations

Sá edited this page Dec 6, 2013 · 3 revisions

All the features added in XMakemol2 can be accessed through the 'Operations' drop-down menu. All the operations are applicable not only to the whole molecule but also to specifically selected atoms. It also worth mentioning that all the operations have an “Undo” and “Discard all” feature.

Index

Add/Remove atoms

To add an atom the user just has to give the coordinates of the new atom. To delete an atom all the user has to do is select it and click “Delete atom”.

Translation

To learn more about 3D translation check out http://demonstrations.wolfram.com/Understanding3DTranslation/.

Routine

void translate(double *)

Window

Translation window

Input

Translation vector.

Default value

(0,0,0)

Operation steps

  1. Add vector to the atoms’ coordinates.

Inversion

Routine

void invert_atoms(double, double, double)

Window

Inversion window

Input

Inversion point.

Default value

(0,0,0)

Operation steps

  1. Translate coordinates so the inversion point will be at origin.
  2. Multiply coordinates by -1.
  3. Translate coordinates back to original position.

Rotation

To learn more about 3D rotation check out http://demonstrations.wolfram.com/Understanding3DRotation/.

Routine

void rot_ate(double, int, int, int)

Window

Rotation window

Input

Two points (to define the axis) and the rotation angle (in degrees).

Default value

None.

Operation steps

  1. Define the rotation axis with the two given points.
  2. Translate the rotation axis to the origin (by translating all the atoms).
  3. A first rotation is made to align the rotation axis with the z axis.
  4. Calculate the new coordinates through the z axis rotation matrix (where u is the unit vector representing the rotation axis and θ is our angle).

Z axis rotation matrix

Reflection

To learn more about 3D reflection check out http://demonstrations.wolfram.com/Understanding3DReflection/.

Routine

void reflect_atoms(double *, double *, double)

Window

Reflection window

Input

Two vectors and a point, or, three points (these define the reflection plane).

Default value

None.

Operation steps

  1. Calculate the cross product of the two vectors that define the plane (we will call it v).
  2. Calculate the dot product of v and z (to find the rotation angle).
  3. Calculate the cross product of v and z (to find the rotation axis).
  4. Rotate the reflection plane so it is parallel to the XY plane.
  5. Translate the reflection plane to the XY plane.
  6. Multiply the coordinates by -1.
  7. Translate the reflection plane back to its original height.
  8. Rotate back to the original orientation.