Skip to contents

Computes the distances between a central set of atoms and an expanded set, using the metric tensor for accuracy.

Usage

calculate_distances(
  atomic_coordinates,
  expanded_coords,
  unit_cell_metrics,
  tolerance = 1e-06
)

Arguments

atomic_coordinates

A data.table of the primary (asymmetric) atom set.

expanded_coords

A data.table of atoms in the expanded supercell.

unit_cell_metrics

A data.table with cell parameters.

tolerance

A numeric cutoff (default 1e-6). Distances smaller than this value are considered floating-point noise (overlapping atoms) and are filtered out.

Value

A data.table of all non-zero distances.

Examples

ac <- data.table::data.table(Label = "Si1", x_a = 0, y_b = 0, z_c = 0)
ec <- data.table::data.table(Label = "O1_1", x_a = 0.5, y_b = 0.5, z_c = 0.5)
uc <- data.table::data.table(`_cell_length_a` = 10, `_cell_length_b` = 10,
                             `_cell_length_c` = 10, `_cell_angle_alpha` = 90,
                             `_cell_angle_beta` = 90, `_cell_angle_gamma` = 90)
calculate_distances(ac, ec, uc)
#>     Atom1  Atom2 Distance DeltaX DeltaY DeltaZ
#>    <char> <char>    <num>  <num>  <num>  <num>
#> 1:    Si1   O1_1 8.660254   -0.5   -0.5   -0.5