Skip to content

Instantly share code, notes, and snippets.

View framkant's full-sized avatar

Filip Wänström framkant

View GitHub Profile
@paniq
paniq / miller_101.py
Last active April 12, 2024 16:02
The BCC Coordinate System
"""
a demo of how to convert from cubic to BCC lattice, analog to the tetrahedral
or FCC lattice, but without the headache of having to manage an interlaced grid
structure as with the usual approach, at the expense of a diagonally skewed
non-cubic bounding box in cartesian coordinates.
an integer conversion from bcc to cartesian coordinates is as easy as
x = -tx+ty+tz