eon.geometry.cell

Cell matrix helpers (row-vector lattice, ASE/vesin convention).

Module Contents

Functions

length_angle_to_box

Convert cell lengths + CON angles (degrees) to a 3×3 row-vector box.

box_to_length_angle

Inverse of :func:length_angle_to_box: lengths and (alpha, beta, gamma).

API

eon.geometry.cell.length_angle_to_box(boxlengths, angles) → numpy.ndarray[source]

Convert cell lengths + CON angles (degrees) to a 3×3 row-vector box.

angles is (alpha, beta, gamma) as CON header line 4 specifies: alpha = angle(b, c), beta = angle(a, c), gamma = angle(a, b). Vector a lies on x and b in the xy plane.

eon.geometry.cell.box_to_length_angle(box) → tuple[numpy.ndarray, numpy.ndarray][source]

Inverse of :func:length_angle_to_box: lengths and (alpha, beta, gamma).

The cosine is the raw dot product over the product of the lengths, clamped to [-1, 1], then libm acos. That is the same map the C++ writer uses, so both sides spell the same angle bytes.