-
Notifications
You must be signed in to change notification settings - Fork 1
Operations
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.
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”.
To learn more about 3D translation check out http://demonstrations.wolfram.com/Understanding3DTranslation/.
void translate(double *)
Translation vector.
(0,0,0)
- Add vector to the atoms’ coordinates.
void invert_atoms(double, double, double)
Inversion point.
(0,0,0)
- Translate coordinates so the inversion point will be at origin.
- Multiply coordinates by -1.
- Translate coordinates back to original position.
To learn more about 3D rotation check out http://demonstrations.wolfram.com/Understanding3DRotation/.
void rot_ate(double, int, int, int)
Two points (to define the axis) and the rotation angle (in degrees).
None.
- Define the rotation axis with the two given points.
- Translate the rotation axis to the origin (by translating all the atoms).
- A first rotation is made to align the rotation axis with the z axis.
- Calculate the new coordinates through the z axis rotation matrix (where u is the unit vector representing the rotation axis and θ is our angle).
To learn more about 3D reflection check out http://demonstrations.wolfram.com/Understanding3DReflection/.
void reflect_atoms(double *, double *, double)
Two vectors and a point, or, three points (these define the reflection plane).
None.
- Calculate the cross product of the two vectors that define the plane (we will call it v).
- Calculate the dot product of v and z (to find the rotation angle).
- Calculate the cross product of v and z (to find the rotation axis).
- Rotate the reflection plane so it is parallel to the XY plane.
- Translate the reflection plane to the XY plane.
- Multiply the coordinates by -1.
- Translate the reflection plane back to its original height.
- Rotate back to the original orientation.