fn subtract_geometries(geom1: &Geometry, geom2: &Geometry) -> Vec<f64>Expand description
Subtracts two geometries coordinate-wise to compute displacement vectors.
This function performs element-wise subtraction of coordinate arrays to compute the displacement vector between two molecular geometries. The result represents the direction and magnitude of atomic movements.
§Mathematical Operation
For geometries with coordinates [x₁, y₁, z₁, x₂, y₂, z₂, …]:
displacement = geom1 - geom2 = [x₁¹-x₁², y₁¹-y₁², z₁¹-z₁², ...]§Arguments
geom1- First geometry (minuend)geom2- Second geometry (subtrahend)
§Returns
Vector of coordinate differences with length 3×N_atoms, where each group of 3 elements represents [Δx, Δy, Δz] for one atom.
§Applications
- Tangent vectors: Compute path directions in NEB
- Displacement analysis: Understand atomic movements
- Force calculations: Determine direction of coordinate changes
- Path characterization: Analyze reaction coordinate changes
§Vector Interpretation
The resulting vector points from geom2 toward geom1:
- Positive components: Atom moved in positive coordinate direction
- Negative components: Atom moved in negative coordinate direction
- Zero components: No movement in that coordinate direction