(x, lat)
| 1601 | |
| 1602 | |
| 1603 | def cartesian_to_reciprocal(x, lat): |
| 1604 | s = Vector3(*[1 if v == 0 else v for v in lat.size]) |
| 1605 | |
| 1606 | m = Matrix(Vector3(s.x), Vector3(y=s.y), Vector3(z=s.z)) |
| 1607 | Rst = (lat.basis * m).transpose() |
| 1608 | |
| 1609 | return Rst * x if isinstance(x, Vector3) else (Rst * x) * Rst.inverse() |
| 1610 | |
| 1611 | |
| 1612 | def lattice_to_reciprocal(x, lat): |
no test coverage detected