# propka.calculations

## Calculations

Mathematical helper functions.

Module Attributes

`MAX_DISTANCE` | Maximum distance used to bound calculations of smallest distance

Functions

`distance`(atom1, atom2) | Calculate the distance between two atoms.
`get_smallest_distance`(atoms1, atoms2) | Calculate the smallest distance between two groups of atoms.
`squared_distance`(atom1, atom2) | Calculate the squared distance between two atoms.

propka.calculations.MAX_DISTANCE = 1000000.0

  Maximum distance used to bound calculations of smallest distance

propka.calculations.distance(atom1: _XYZ, atom2: _XYZ) → float

  Calculate the distance between two atoms.

  Parameters:

    - atom1 – first atom for distance calculation

    - atom2 – second atom for distance calculation

  Returns:

    distance

propka.calculations.get_smallest_distance(atoms1: Iterable[_BoundXYZ_1], atoms2: Iterable[_BoundXYZ_2]) → Tuple[_BoundXYZ_1 | None, float, _BoundXYZ_2 | None]

  Calculate the smallest distance between two groups of atoms.

  Parameters:

    - atoms1 – atom group 1

    - atoms2 – atom group 2

  Returns:

    smallest distance between groups

propka.calculations.squared_distance(atom1: _XYZ, atom2: _XYZ) → float

  Calculate the squared distance between two atoms.

  Parameters:

    - atom1 – first atom for distance calculation

    - atom2 – second atom for distance calculation

  Returns:

    distance squared