# pymatgen.analysis.chemenv.utils.math_utils module

This module contains some math utils that are used in the chemenv package.

cosinus_step(xx, edges=None, inverse=False)
  Parameters

    - xx –

    - edges –

    - inverse –

  Returns

divisors(n)

  From a given natural integer, returns the list of divisors in ascending order :param n: Natural integer :return: List of divisors of n in ascending order

get_center_of_arc(p1, p2, radius)
  Parameters

    - p1 –

    - p2 –

    - radius –

  Returns

get_linearly_independent_vectors(vectors_list)
  Parameters

    vectors_list –

  Returns

normal_cdf_step(xx, mean, scale)
  Parameters

    - xx –

    - mean –

    - scale –

  Returns

power2_decreasing_exp(xx, edges=None, alpha=1.0)
  Parameters

    - xx –

    - edges –

    - alpha –

  Returns

power2_inverse_decreasing(xx, edges=None, prefactor=None)
  Parameters

    - xx –

    - edges –

    - prefactor –

  Returns

power2_inverse_power2_decreasing(xx, edges=None, prefactor=None)
  Parameters

    - xx –

    - edges –

    - prefactor –

  Returns

power2_inverse_powern_decreasing(xx, edges=None, prefactor=None, powern=2.0)
  Parameters

    - xx –

    - edges –

    - prefactor –

    - powern –

  Returns

power2_tangent_decreasing(xx, edges=None, prefactor=None)
  Parameters

    - xx –

    - edges –

    - prefactor –

  Returns

power3_step(xx, edges=None, inverse=False)
  Parameters

    - xx –

    - edges –

    - inverse –

  Returns

powern_decreasing(xx, edges=None, nn=2)
  Parameters

    - xx –

    - edges –

    - nn –

  Returns

powern_parts_step(xx, edges=None, inverse=False, nn=2)
  Parameters

    - xx –

    - edges –

    - inverse –

    - nn –

  Returns

prime_factors(n)

  Lists prime factors of a given natural integer, from greatest to smallest :param n: Natural integer :rtype : list of all prime factors of the given natural n

scale_and_clamp(xx, edge0, edge1, clamp0, clamp1)
  Parameters

    - xx –

    - edge0 –

    - edge1 –

    - clamp0 –

    - clamp1 –

  Returns

smootherstep(xx, edges=None, inverse=False)
  Parameters

    - xx –

    - edges –

    - inverse –

  Returns

smoothstep(xx, edges=None, inverse=False)
  Parameters

    - xx –

    - edges –

    - inverse –

  Returns