symcrys 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/README.md +6 -6
  2. package/dist/cell.d.ts +19 -16
  3. package/dist/cell.d.ts.map +1 -1
  4. package/dist/cell.js +63 -35
  5. package/dist/cell.js.map +1 -1
  6. package/dist/checks.d.ts +29 -0
  7. package/dist/checks.d.ts.map +1 -0
  8. package/dist/checks.js +79 -0
  9. package/dist/checks.js.map +1 -0
  10. package/dist/closure.d.ts +43 -0
  11. package/dist/closure.d.ts.map +1 -0
  12. package/dist/closure.js +201 -0
  13. package/dist/closure.js.map +1 -0
  14. package/dist/crystalClasses.d.ts +146 -118
  15. package/dist/crystalClasses.d.ts.map +1 -1
  16. package/dist/crystalClasses.js +163 -124
  17. package/dist/crystalClasses.js.map +1 -1
  18. package/dist/freeze.d.ts +7 -0
  19. package/dist/freeze.d.ts.map +1 -0
  20. package/dist/freeze.js +15 -0
  21. package/dist/freeze.js.map +1 -0
  22. package/dist/index.d.ts +11 -10
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +4 -3
  25. package/dist/index.js.map +1 -1
  26. package/dist/indices.d.ts +31 -5
  27. package/dist/indices.d.ts.map +1 -1
  28. package/dist/indices.js +104 -13
  29. package/dist/indices.js.map +1 -1
  30. package/dist/lattice.d.ts +15 -1
  31. package/dist/lattice.d.ts.map +1 -1
  32. package/dist/lattice.js +30 -1
  33. package/dist/lattice.js.map +1 -1
  34. package/dist/linalg.d.ts +2 -2
  35. package/dist/linalg.d.ts.map +1 -1
  36. package/dist/linalg.js +3 -3
  37. package/dist/linalg.js.map +1 -1
  38. package/dist/magnetic.d.ts +12 -10
  39. package/dist/magnetic.d.ts.map +1 -1
  40. package/dist/magnetic.js +8 -6
  41. package/dist/magnetic.js.map +1 -1
  42. package/dist/notation.d.ts +16 -0
  43. package/dist/notation.d.ts.map +1 -0
  44. package/dist/notation.js +66 -0
  45. package/dist/notation.js.map +1 -0
  46. package/dist/operations.d.ts +40 -26
  47. package/dist/operations.d.ts.map +1 -1
  48. package/dist/operations.js +48 -60
  49. package/dist/operations.js.map +1 -1
  50. package/dist/plane.d.ts +141 -79
  51. package/dist/plane.d.ts.map +1 -1
  52. package/dist/plane.js +147 -77
  53. package/dist/plane.js.map +1 -1
  54. package/dist/pointGroups/crystalForms.d.ts +6 -21
  55. package/dist/pointGroups/crystalForms.d.ts.map +1 -1
  56. package/dist/pointGroups/crystalForms.js +9 -16
  57. package/dist/pointGroups/crystalForms.js.map +1 -1
  58. package/dist/pointGroups/crystalFormsData.d.ts +4 -1
  59. package/dist/pointGroups/crystalFormsData.d.ts.map +1 -1
  60. package/dist/pointGroups/crystalFormsData.js +64 -1
  61. package/dist/pointGroups/crystalFormsData.js.map +1 -1
  62. package/dist/pointGroups/elements.d.ts +19 -17
  63. package/dist/pointGroups/elements.d.ts.map +1 -1
  64. package/dist/pointGroups/elements.js +65 -83
  65. package/dist/pointGroups/elements.js.map +1 -1
  66. package/dist/pointGroups/identify.d.ts +10 -18
  67. package/dist/pointGroups/identify.d.ts.map +1 -1
  68. package/dist/pointGroups/identify.js +27 -79
  69. package/dist/pointGroups/identify.js.map +1 -1
  70. package/dist/pointGroups/itaOrder.d.ts +15 -14
  71. package/dist/pointGroups/itaOrder.d.ts.map +1 -1
  72. package/dist/pointGroups/itaOrder.js +116 -94
  73. package/dist/pointGroups/itaOrder.js.map +1 -1
  74. package/dist/pointGroups/itcData.d.ts +96 -0
  75. package/dist/pointGroups/itcData.d.ts.map +1 -0
  76. package/dist/pointGroups/itcData.js +336 -0
  77. package/dist/pointGroups/itcData.js.map +1 -0
  78. package/dist/pointGroups/itcMagneticData.d.ts +55 -0
  79. package/dist/pointGroups/itcMagneticData.d.ts.map +1 -0
  80. package/dist/pointGroups/itcMagneticData.js +172 -0
  81. package/dist/pointGroups/itcMagneticData.js.map +1 -0
  82. package/dist/pointGroups/keys.d.ts +32 -0
  83. package/dist/pointGroups/keys.d.ts.map +1 -0
  84. package/dist/pointGroups/keys.js +120 -0
  85. package/dist/pointGroups/keys.js.map +1 -0
  86. package/dist/pointGroups/magneticSymbols.d.ts +6 -5
  87. package/dist/pointGroups/magneticSymbols.d.ts.map +1 -1
  88. package/dist/pointGroups/magneticSymbols.js +15 -12
  89. package/dist/pointGroups/magneticSymbols.js.map +1 -1
  90. package/dist/pointGroups/orbits.d.ts +23 -42
  91. package/dist/pointGroups/orbits.d.ts.map +1 -1
  92. package/dist/pointGroups/orbits.js +20 -62
  93. package/dist/pointGroups/orbits.js.map +1 -1
  94. package/dist/pointGroups/pointGroups.d.ts +135 -67
  95. package/dist/pointGroups/pointGroups.d.ts.map +1 -1
  96. package/dist/pointGroups/pointGroups.js +409 -244
  97. package/dist/pointGroups/pointGroups.js.map +1 -1
  98. package/dist/pointGroups/properties.d.ts +21 -22
  99. package/dist/pointGroups/properties.d.ts.map +1 -1
  100. package/dist/pointGroups/properties.js +40 -37
  101. package/dist/pointGroups/properties.js.map +1 -1
  102. package/dist/pointGroups/seitzData.d.ts +26 -0
  103. package/dist/pointGroups/seitzData.d.ts.map +1 -0
  104. package/dist/pointGroups/seitzData.js +130 -0
  105. package/dist/pointGroups/seitzData.js.map +1 -0
  106. package/dist/pointGroups/wyckoff.d.ts +70 -40
  107. package/dist/pointGroups/wyckoff.d.ts.map +1 -1
  108. package/dist/pointGroups/wyckoff.js +98 -91
  109. package/dist/pointGroups/wyckoff.js.map +1 -1
  110. package/dist/pointGroups/wyckoffData.d.ts +7 -4
  111. package/dist/pointGroups/wyckoffData.d.ts.map +1 -1
  112. package/dist/pointGroups/wyckoffData.js +789 -168
  113. package/dist/pointGroups/wyckoffData.js.map +1 -1
  114. package/dist/siteSymmetry.d.ts +9 -17
  115. package/dist/siteSymmetry.d.ts.map +1 -1
  116. package/dist/siteSymmetry.js +62 -47
  117. package/dist/siteSymmetry.js.map +1 -1
  118. package/dist/spaceGroups/affine.d.ts.map +1 -1
  119. package/dist/spaceGroups/affine.js +3 -2
  120. package/dist/spaceGroups/affine.js.map +1 -1
  121. package/dist/spaceGroups/cell.d.ts +43 -31
  122. package/dist/spaceGroups/cell.d.ts.map +1 -1
  123. package/dist/spaceGroups/cell.js +173 -85
  124. package/dist/spaceGroups/cell.js.map +1 -1
  125. package/dist/spaceGroups/describe.d.ts +12 -10
  126. package/dist/spaceGroups/describe.d.ts.map +1 -1
  127. package/dist/spaceGroups/describe.js +11 -10
  128. package/dist/spaceGroups/describe.js.map +1 -1
  129. package/dist/spaceGroups/planeGroupData.d.ts +1 -1
  130. package/dist/spaceGroups/planeGroupData.d.ts.map +1 -1
  131. package/dist/spaceGroups/planeGroupData.js +8 -8
  132. package/dist/spaceGroups/planeGroupData.js.map +1 -1
  133. package/dist/spaceGroups/planeGroups.d.ts.map +1 -1
  134. package/dist/spaceGroups/planeGroups.js +2 -1
  135. package/dist/spaceGroups/planeGroups.js.map +1 -1
  136. package/dist/spaceGroups/positions.d.ts +48 -19
  137. package/dist/spaceGroups/positions.d.ts.map +1 -1
  138. package/dist/spaceGroups/positions.js +166 -67
  139. package/dist/spaceGroups/positions.js.map +1 -1
  140. package/dist/tensors/propertyTable.d.ts +3 -1
  141. package/dist/tensors/propertyTable.d.ts.map +1 -1
  142. package/dist/tensors/propertyTable.js +17 -10
  143. package/dist/tensors/propertyTable.js.map +1 -1
  144. package/dist/tensors/rowEchelon.d.ts +12 -4
  145. package/dist/tensors/rowEchelon.d.ts.map +1 -1
  146. package/dist/tensors/rowEchelon.js +24 -11
  147. package/dist/tensors/rowEchelon.js.map +1 -1
  148. package/dist/tensors/tensorForm.d.ts +75 -34
  149. package/dist/tensors/tensorForm.d.ts.map +1 -1
  150. package/dist/tensors/tensorForm.js +173 -68
  151. package/dist/tensors/tensorForm.js.map +1 -1
  152. package/dist/tensors/tensorProperties.d.ts +10 -9
  153. package/dist/tensors/tensorProperties.d.ts.map +1 -1
  154. package/dist/tensors/tensorProperties.js +22 -12
  155. package/dist/tensors/tensorProperties.js.map +1 -1
  156. package/dist/tolerances.d.ts +56 -1
  157. package/dist/tolerances.d.ts.map +1 -1
  158. package/dist/tolerances.js +51 -1
  159. package/dist/tolerances.js.map +1 -1
  160. package/dist/version.d.ts +1 -1
  161. package/dist/version.js +1 -1
  162. package/package.json +1 -1
  163. package/src/cell.ts +78 -51
  164. package/src/checks.ts +84 -0
  165. package/src/closure.ts +214 -0
  166. package/src/crystalClasses.ts +234 -160
  167. package/src/freeze.ts +14 -0
  168. package/src/index.ts +21 -10
  169. package/src/indices.ts +108 -18
  170. package/src/lattice.ts +41 -1
  171. package/src/linalg.ts +3 -3
  172. package/src/magnetic.ts +14 -9
  173. package/src/notation.ts +73 -0
  174. package/src/operations.ts +78 -69
  175. package/src/plane.ts +253 -127
  176. package/src/pointGroups/crystalForms.ts +11 -44
  177. package/src/pointGroups/crystalFormsData.ts +66 -1
  178. package/src/pointGroups/elements.ts +82 -92
  179. package/src/pointGroups/identify.ts +38 -97
  180. package/src/pointGroups/itaOrder.ts +117 -101
  181. package/src/pointGroups/itcData.ts +404 -0
  182. package/src/pointGroups/itcMagneticData.ts +206 -0
  183. package/src/pointGroups/keys.ts +144 -0
  184. package/src/pointGroups/magneticSymbols.ts +18 -17
  185. package/src/pointGroups/orbits.ts +41 -89
  186. package/src/pointGroups/pointGroups.ts +540 -297
  187. package/src/pointGroups/properties.ts +44 -40
  188. package/src/pointGroups/seitzData.ts +147 -0
  189. package/src/pointGroups/wyckoff.ts +137 -112
  190. package/src/pointGroups/wyckoffData.ts +793 -170
  191. package/src/siteSymmetry.ts +71 -64
  192. package/src/spaceGroups/affine.ts +3 -2
  193. package/src/spaceGroups/cell.ts +227 -116
  194. package/src/spaceGroups/describe.ts +22 -19
  195. package/src/spaceGroups/planeGroupData.ts +9 -9
  196. package/src/spaceGroups/planeGroups.ts +2 -1
  197. package/src/spaceGroups/positions.ts +202 -78
  198. package/src/tensors/propertyTable.ts +29 -17
  199. package/src/tensors/rowEchelon.ts +28 -9
  200. package/src/tensors/tensorForm.ts +260 -89
  201. package/src/tensors/tensorProperties.ts +34 -14
  202. package/src/tolerances.ts +66 -1
  203. package/src/version.ts +1 -1
  204. package/dist/pointGroups/data.d.ts +0 -75
  205. package/dist/pointGroups/data.d.ts.map +0 -1
  206. package/dist/pointGroups/data.js +0 -212
  207. package/dist/pointGroups/data.js.map +0 -1
  208. package/dist/pointGroups/magneticData.d.ts +0 -66
  209. package/dist/pointGroups/magneticData.d.ts.map +0 -1
  210. package/dist/pointGroups/magneticData.js +0 -184
  211. package/dist/pointGroups/magneticData.js.map +0 -1
  212. package/dist/spaceGroups/snap.d.ts +0 -20
  213. package/dist/spaceGroups/snap.d.ts.map +0 -1
  214. package/dist/spaceGroups/snap.js +0 -103
  215. package/dist/spaceGroups/snap.js.map +0 -1
  216. package/src/pointGroups/data.ts +0 -305
  217. package/src/pointGroups/magneticData.ts +0 -328
  218. package/src/spaceGroups/snap.ts +0 -121
package/dist/index.d.ts CHANGED
@@ -6,18 +6,19 @@
6
6
  * SemVer (see CLAUDE.md); everything else is internal.
7
7
  */
8
8
  export { VERSION } from './version.js';
9
+ export { EPSILON, type ToleranceOptions } from './tolerances.js';
9
10
  export type { Mat3, Vec3 } from './linalg.js';
10
- export { crystalFamily, latticeBasis, type CrystalFamily, type CrystalSystem, type FixedAngleFamily, } from './lattice.js';
11
- export { angleBetweenDirections, angleBetweenPlanes, isValidCell, latticeFromParameters, latticeParameters, metricTensor, reciprocalBasis, type CellAngles, type CellOperation, type IsValidCellOptions, type LatticeParameters, type ResidualOperationsOptions, } from './cell.js';
12
- export { changeOfAxes, directionFromFourIndices, directionToFourIndices, planeFromFourIndices, planeToFourIndices, reduceIndices, zoneAxis, type AxisChange, type FourIndices, } from './indices.js';
13
- export type { Convention, PointGroupKey, Setting, SettingOptions, SymbolOptions } from './pointGroups/pointGroups.js';
11
+ export { crystalFamily, latticeBasis, type CrystalFamily, type CrystalSystem, type FixedAngleFamily, type LatticeSystem, } from './lattice.js';
12
+ export { angleBetweenDirections, angleBetweenPlanes, faceNormal, isValidCell, latticeFromParameters, latticeParameters, metricTensor, reciprocalBasis, type CellAngles, type CellOperation, type IsValidCellOptions, type LatticeParameters, } from './cell.js';
13
+ export { changeOfAxes, directionFromFourIndices, directionToFourIndices, planeFromFourIndices, planeToFourIndices, millerIndices, reduceIndices, zoneAxis, type AxisChange, type FourIndices, type MillerValues, } from './indices.js';
14
+ export type { PointGroupKey, Setting, AxesOptions, SettingOptions, SymbolOptions } from './pointGroups/pointGroups.js';
14
15
  export { LATTICE_SYMMETRY_DIRECTIONS, type Uvw } from './symmetryDirections.js';
15
16
  export type { Axis, DirectionElements, OperationKind, SymmetryDirection } from './pointGroups/elements.js';
16
- export type { SiteSymmetry, SiteSymmetryOptions } from './siteSymmetry.js';
17
- export type { Hkl, WyckoffOptions, WyckoffPosition } from './pointGroups/wyckoff.js';
17
+ export type { SiteSymmetry } from './siteSymmetry.js';
18
+ export type { Hkl, WyckoffPosition } from './pointGroups/wyckoff.js';
18
19
  export type { CrystalForm, CrystalFormType } from './pointGroups/crystalForms.js';
19
- export type { DirectionOrbitEntry, FaceOrbitEntry, OrbitOptions, OrbitPole } from './pointGroups/orbits.js';
20
- export type { CartesianAxis, PointGroupOfOptions } from './pointGroups/identify.js';
21
- export type { IntrinsicSymmetry, TensorForm, TensorParity, TensorRank } from './tensors/tensorForm.js';
22
- export { CRYSTAL_FORM_TYPES, POINT_GROUP_KEYS, TENSOR_PROPERTIES, allowedProperties, allowedPropertiesOf, allowsProperty, allowsPropertyOf, crystalForms, describeOperations, describeOperationsOf, findPointGroup, generators, holohedry, isCentrosymmetricOf, isChiralOf, isPointGroupKey, latticeOperations, residualOperations, operations, orbit, orbitOf, pointGroup, pointGroupOf, pointGroups, rotateTensor, settings, siteSymmetry, symbol, symmetryDirections, tensorForm, tensorFormOf, wyckoffPositionOf, wyckoffPositions, type CartesianOperationDescription, type IdentifiedPointGroup, type Operation, type OperationDescription, type PointGroup, type PointGroupInSetting, type TensorProperty, type TensorPropertyName, type TensorSpec, } from './crystalClasses.js';
20
+ export type { DirectionIndices, DirectionOrbitEntry, FaceIndices, FaceOrbitEntry, OrbitPole, } from './pointGroups/orbits.js';
21
+ export type { CartesianAxis } from './pointGroups/identify.js';
22
+ export type { IntrinsicSymmetry, TensorForm, TensorKind, TensorRank } from './tensors/tensorForm.js';
23
+ export { CRYSTAL_FORM_TYPES, POINT_GROUP_KEYS, TENSOR_PROPERTIES, allowedProperties, allowedPropertiesOf, allowsProperty, allowsPropertyOf, crystalForms, describeOperations, describeOperationsOf, findPointGroup, generators, holohedry, isCentrosymmetricOf, isEnantiomorphicOf, isPointGroupKey, latticeSystems, residualOperations, operations, orbit, orbitOf, pointGroup, pointGroupOf, pointGroups, rotateTensor, settings, siteSymmetry, siteSymmetryOf, symbol, symmetryDirections, tensorForm, tensorFormOf, wyckoffPosition, wyckoffPositions, type CartesianOperationDescription, type IdentifiedPointGroup, type Operation, type OperationDescription, type PointGroup, type PointGroupInSetting, type TensorProperty, type TensorPropertyName, type TensorSpec, } from './crystalClasses.js';
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,G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.md); everything else is internal.
7
7
  */
8
8
  export { VERSION } from './version.js';
9
+ export { EPSILON } from './tolerances.js';
9
10
  export { crystalFamily, latticeBasis, } from './lattice.js';
10
- export { angleBetweenDirections, angleBetweenPlanes, isValidCell, latticeFromParameters, latticeParameters, metricTensor, reciprocalBasis, } from './cell.js';
11
- export { changeOfAxes, directionFromFourIndices, directionToFourIndices, planeFromFourIndices, planeToFourIndices, reduceIndices, zoneAxis, } from './indices.js';
11
+ export { angleBetweenDirections, angleBetweenPlanes, faceNormal, isValidCell, latticeFromParameters, latticeParameters, metricTensor, reciprocalBasis, } from './cell.js';
12
+ export { changeOfAxes, directionFromFourIndices, directionToFourIndices, planeFromFourIndices, planeToFourIndices, millerIndices, reduceIndices, zoneAxis, } from './indices.js';
12
13
  export { LATTICE_SYMMETRY_DIRECTIONS } from './symmetryDirections.js';
13
- export { CRYSTAL_FORM_TYPES, POINT_GROUP_KEYS, TENSOR_PROPERTIES, allowedProperties, allowedPropertiesOf, allowsProperty, allowsPropertyOf, crystalForms, describeOperations, describeOperationsOf, findPointGroup, generators, holohedry, isCentrosymmetricOf, isChiralOf, isPointGroupKey, latticeOperations, residualOperations, operations, orbit, orbitOf, pointGroup, pointGroupOf, pointGroups, rotateTensor, settings, siteSymmetry, symbol, symmetryDirections, tensorForm, tensorFormOf, wyckoffPositionOf, wyckoffPositions, } from './crystalClasses.js';
14
+ export { CRYSTAL_FORM_TYPES, POINT_GROUP_KEYS, TENSOR_PROPERTIES, allowedProperties, allowedPropertiesOf, allowsProperty, allowsPropertyOf, crystalForms, describeOperations, describeOperationsOf, findPointGroup, generators, holohedry, isCentrosymmetricOf, isEnantiomorphicOf, isPointGroupKey, latticeSystems, residualOperations, operations, orbit, orbitOf, pointGroup, pointGroupOf, pointGroups, rotateTensor, settings, siteSymmetry, siteSymmetryOf, symbol, symmetryDirections, tensorForm, tensorFormOf, wyckoffPosition, wyckoffPositions, } from './crystalClasses.js';
14
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EACL,aAAa,EACb,YAAY,GAIb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,eAAe,GAMhB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,QAAQ,GAGT,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,2BAA2B,EAAY,MAAM,yBAAyB,CAAC;AAShF,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,OAAO,EACP,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,GAUjB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAyB,MAAM,iBAAiB,CAAC;AAGjE,OAAO,EACL,aAAa,EACb,YAAY,GAKb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,eAAe,GAKhB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,QAAQ,GAIT,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,2BAA2B,EAAY,MAAM,yBAAyB,CAAC;AAehF,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,OAAO,EACP,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,eAAe,EACf,gBAAgB,GAUjB,MAAM,qBAAqB,CAAC"}
package/dist/indices.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Miller and Miller–Bravais indices, the zone law and the change of axes
2
+ * Miller and Bravais–Miller indices, the zone law and the change of axes
3
3
  * (docs/conventions.md, "Cell, metric and indices"). Plain integers and matrices in and out.
4
4
  */
5
5
  import { type Mat3, type Vec3 } from './linalg.js';
6
- /** A direction [UVTW] or a plane (hkil) in four indices (Miller–Bravais). */
6
+ /** A direction [UVTW] or a plane (hkil) in four indices (Bravais–Miller). */
7
7
  export type FourIndices = readonly [number, number, number, number];
8
8
  /** The indices divided by their greatest common divisor, signs kept. Throws a RangeError for non-integers and for all zeros. */
9
- export declare function reduceIndices(indices: readonly number[]): number[];
9
+ export declare function reduceIndices(indices: readonly number[]): readonly number[];
10
10
  /** The plane (hkl) of hexagonal axes as (hkil) with i = −(h + k). */
11
11
  export declare function planeToFourIndices(hkl: Vec3): FourIndices;
12
12
  /** The plane (hkil) as (hkl); throws a RangeError unless i = −(h + k). */
@@ -20,9 +20,9 @@ export declare function directionToFourIndices(uvw: Vec3): FourIndices;
20
20
  export declare function directionFromFourIndices(uvtw: FourIndices): Vec3;
21
21
  /**
22
22
  * The zone axis [uvw] of two planes (hkl), which must not be zero vectors: the solution of the zone law hu + kv + lw = 0, the
23
- * cross product h₁ × h₂ reduced (so its sign follows the order of the planes), or `null` for parallel planes.
23
+ * cross product h₁ × h₂ reduced (so its sign follows the order of the planes), or `undefined` for parallel planes.
24
24
  */
25
- export declare function zoneAxis(h1: Vec3, h2: Vec3): Vec3 | null;
25
+ export declare function zoneAxis(h1: Vec3, h2: Vec3): Vec3 | undefined;
26
26
  /** The matrices that carry coordinates of a direction and indices of a plane to a new basis. */
27
27
  export interface AxisChange {
28
28
  /** Q = P⁻¹: the coordinates [uvw]′ = Q·[uvw] of a direction in the new basis. */
@@ -39,4 +39,30 @@ export interface AxisChange {
39
39
  * column lengths).
40
40
  */
41
41
  export declare function changeOfAxes(P: Mat3): AxisChange;
42
+ /** The values of h, k, l substituted into printed Miller indices. */
43
+ export interface MillerValues {
44
+ /** The value of h, an integer. */
45
+ readonly h?: number;
46
+ /** The value of k, an integer. */
47
+ readonly k?: number;
48
+ /** The value of l, an integer. */
49
+ readonly l?: number;
50
+ }
51
+ /**
52
+ * Printed Miller indices, three or four (Bravais–Miller, hexagonal axes) separated by commas, as
53
+ * three numbers (hkl) with the given values of h, k, l; four lose i, which must be −(h + k). Internal:
54
+ * `fail` makes the error.
55
+ */
56
+ export declare function substituteMillerIndices(printed: string, values: MillerValues, fail: (message: string) => Error): Vec3;
57
+ /**
58
+ * The face (hkl) of printed Miller indices with the caller's values of h, k, l substituted (#137 G3):
59
+ * the printed `h,h,-2h,l` with h = 3 and l = 1 gives (3, 3, 1). The printed strings are those of
60
+ * `wyckoffPositions` and `crystalForms` (`millerIndices`), as ITA prints them: three indices, or four
61
+ * for hexagonal axes, of which i = −(h + k) is dropped, so that the face can be passed to `orbit`
62
+ * (`planeToFourIndices` gives the four). Each value is an integer; only the letters the string uses
63
+ * are needed. The face is not reduced, and whether the values keep it in its position (a general
64
+ * face (hkl) with h = k lies on a special one) is the caller's choice. Throws a RangeError for an
65
+ * unreadable string, a missing or non-integer value, an unknown key and the face (000).
66
+ */
67
+ export declare function millerIndices(printed: string, values: MillerValues): Vec3;
42
68
  //# sourceMappingURL=indices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"indices.d.ts","sourceRoot":"","sources":["../src/indices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuC,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExF,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAsBpE,gIAAgI;AAChI,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAKlE;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,IAAI,GAAG,WAAW,CAIzD;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAK5D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,IAAI,GAAG,WAAW,CAK7D;AAED,oHAAoH;AACpH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAMhE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CASxD;AAED,gGAAgG;AAChG,MAAM,WAAW,UAAU;IACz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AAU,CAYhD;AAED,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;CACrB;AA8BD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,GAAG,IAAI,CAUrH;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAuBzE"}
package/dist/indices.js CHANGED
@@ -1,8 +1,10 @@
1
1
  /**
2
- * Miller and Miller–Bravais indices, the zone law and the change of axes
2
+ * Miller and Bravais–Miller indices, the zone law and the change of axes
3
3
  * (docs/conventions.md, "Cell, metric and indices"). Plain integers and matrices in and out.
4
4
  */
5
+ import { shown } from './checks.js';
5
6
  import { det, inverse, isSingular, transpose } from './linalg.js';
7
+ import { deepFreeze } from './freeze.js';
6
8
  function gcd(a, b) {
7
9
  a = Math.abs(a);
8
10
  b = Math.abs(b);
@@ -15,7 +17,7 @@ function integers(v, who, length) {
15
17
  (length !== undefined && v.length !== length) ||
16
18
  v.length === 0 ||
17
19
  !v.every((x) => Number.isSafeInteger(x))) {
18
- throw new RangeError(`${who}: ${length === undefined ? 'a list of' : length} integers expected, not ${JSON.stringify(v)}`);
20
+ throw new RangeError(`${who}: ${length === undefined ? 'a list of' : length} integers expected, not ${shown(v)}`);
19
21
  }
20
22
  }
21
23
  /** The indices divided by their greatest common divisor, signs kept. Throws a RangeError for non-integers and for all zeros. */
@@ -24,21 +26,21 @@ export function reduceIndices(indices) {
24
26
  const g = indices.reduce(gcd, 0);
25
27
  if (g === 0)
26
28
  throw new RangeError('reduceIndices: all indices are zero');
27
- return indices.map((x) => x / g + 0);
29
+ return deepFreeze(indices.map((x) => x / g + 0));
28
30
  }
29
31
  /** The plane (hkl) of hexagonal axes as (hkil) with i = −(h + k). */
30
32
  export function planeToFourIndices(hkl) {
31
33
  integers(hkl, 'planeToFourIndices', 3);
32
34
  if (hkl.every((x) => x === 0))
33
35
  throw new RangeError('planeToFourIndices: zero vector');
34
- return [hkl[0] + 0, hkl[1] + 0, -(hkl[0] + hkl[1]) + 0, hkl[2] + 0];
36
+ return deepFreeze([hkl[0] + 0, hkl[1] + 0, -(hkl[0] + hkl[1]) + 0, hkl[2] + 0]);
35
37
  }
36
38
  /** The plane (hkil) as (hkl); throws a RangeError unless i = −(h + k). */
37
39
  export function planeFromFourIndices(hkil) {
38
40
  integers(hkil, 'planeFromFourIndices', 4);
39
41
  if (hkil[2] !== -(hkil[0] + hkil[1]))
40
- throw new RangeError(`planeFromFourIndices: i must be −(h + k) in ${JSON.stringify(hkil)}`);
41
- return [hkil[0] + 0, hkil[1] + 0, hkil[3] + 0];
42
+ throw new RangeError(`planeFromFourIndices: i must be −(h + k) in ${shown(hkil)}`);
43
+ return deepFreeze([hkil[0] + 0, hkil[1] + 0, hkil[3] + 0]);
42
44
  }
43
45
  /**
44
46
  * The direction [uvw] of hexagonal axes as [UVTW], reduced: U = (2u − v)/3, V = (2v − u)/3,
@@ -49,7 +51,7 @@ export function directionToFourIndices(uvw) {
49
51
  const [u, v, w] = uvw;
50
52
  if (u === 0 && v === 0 && w === 0)
51
53
  throw new RangeError('directionToFourIndices: zero vector');
52
- return reduceIndices([2 * u - v, 2 * v - u, -(u + v), 3 * w]);
54
+ return deepFreeze(reduceIndices([2 * u - v, 2 * v - u, -(u + v), 3 * w]));
53
55
  }
54
56
  /** The direction [UVTW] as [uvw], reduced: u = U − T, v = V − T, w = W; throws a RangeError unless T = −(U + V). */
55
57
  export function directionFromFourIndices(uvtw) {
@@ -58,12 +60,12 @@ export function directionFromFourIndices(uvtw) {
58
60
  throw new RangeError('directionFromFourIndices: zero vector');
59
61
  const [U, V, T, W] = uvtw;
60
62
  if (T !== -(U + V))
61
- throw new RangeError(`directionFromFourIndices: T must be −(U + V) in ${JSON.stringify(uvtw)}`);
62
- return reduceIndices([U - T, V - T, W]);
63
+ throw new RangeError(`directionFromFourIndices: T must be −(U + V) in ${shown(uvtw)}`);
64
+ return deepFreeze(reduceIndices([U - T, V - T, W]));
63
65
  }
64
66
  /**
65
67
  * The zone axis [uvw] of two planes (hkl), which must not be zero vectors: the solution of the zone law hu + kv + lw = 0, the
66
- * cross product h₁ × h₂ reduced (so its sign follows the order of the planes), or `null` for parallel planes.
68
+ * cross product h₁ × h₂ reduced (so its sign follows the order of the planes), or `undefined` for parallel planes.
67
69
  */
68
70
  export function zoneAxis(h1, h2) {
69
71
  integers(h1, 'zoneAxis', 3);
@@ -74,8 +76,8 @@ export function zoneAxis(h1, h2) {
74
76
  if (!c.every((x) => Number.isSafeInteger(x)))
75
77
  throw new RangeError('zoneAxis: the cross product exceeds the safe integers');
76
78
  if (c.every((x) => x === 0))
77
- return null;
78
- return reduceIndices(c);
79
+ return undefined;
80
+ return deepFreeze(reduceIndices(c));
79
81
  }
80
82
  /**
81
83
  * The transformation of indices for a change of basis (a′, b′, c′) = (a, b, c)·P (ITA Vol. A, 2006,
@@ -96,6 +98,95 @@ export function changeOfAxes(P) {
96
98
  if (isSingular(P))
97
99
  throw new RangeError('changeOfAxes: P is singular within rounding');
98
100
  const clean = (m) => m.map((r) => r.map((x) => x + 0)); // no −0
99
- return { direction: clean(inverse(P)), plane: clean(transpose(P)) };
101
+ return deepFreeze({ direction: clean(inverse(P)), plane: clean(transpose(P)) });
102
+ }
103
+ /**
104
+ * One printed index as a number: a term (`h`, `-2h`, `0`, `1`) or a sum of terms (`-h-k`, `2k-h`, as
105
+ * printed for rhombohedral axes); `i` is −(h + k). `fail` makes the error: a RangeError for a
106
+ * caller's string, a plain Error for the transcribed data.
107
+ */
108
+ function printedIndex(component, values, fail) {
109
+ // A term is a signed number, or a signed letter with an optional factor; terms after the first
110
+ // begin with their sign, so that run-together terms (`hk`, `h2`) are unreadable.
111
+ if (!/^-?(\d+|\d*[hkil])([+-](\d+|\d*[hkil]))*$/.test(component))
112
+ throw fail(`Unreadable Miller index: ${component}`);
113
+ const terms = component.match(/[+-]?\d*[hkil]?/g).filter((t) => t !== '');
114
+ const value = (letter) => {
115
+ const v = values[letter];
116
+ if (v === undefined)
117
+ throw fail(`The Miller index ${component} needs a value of ${letter}`);
118
+ return v;
119
+ };
120
+ const result = terms.reduce((sum, term) => {
121
+ const m = /^([+-]?)(\d*)([hkil]?)$/.exec(term);
122
+ const sign = m[1] === '-' ? -1 : 1;
123
+ const factor = m[2] === '' ? 1 : Number(m[2]);
124
+ if (!Number.isSafeInteger(factor))
125
+ throw fail(`The factor in ${component} is not a safe integer`);
126
+ if (m[3] === '')
127
+ return sum + sign * factor;
128
+ if (m[3] === 'i')
129
+ return sum + sign * factor * -(value('h') + value('k'));
130
+ return sum + sign * factor * value(m[3]);
131
+ }, 0);
132
+ if (!Number.isSafeInteger(result))
133
+ throw fail(`The Miller index ${component} is not a safe integer: ${result}`);
134
+ return result;
135
+ }
136
+ /**
137
+ * Printed Miller indices, three or four (Bravais–Miller, hexagonal axes) separated by commas, as
138
+ * three numbers (hkl) with the given values of h, k, l; four lose i, which must be −(h + k). Internal:
139
+ * `fail` makes the error.
140
+ */
141
+ export function substituteMillerIndices(printed, values, fail) {
142
+ const components = printed.split(',').map((c) => c.trim());
143
+ // i is the third of four indices; ITA prints no i among three.
144
+ if (components.length === 3 && components.some((c) => c.includes('i'))) {
145
+ throw fail(`Unreadable Miller indices: ${printed} (i among three indices)`);
146
+ }
147
+ const parts = components.map((c) => printedIndex(c, values, fail) + 0);
148
+ if (parts.length === 3)
149
+ return [parts[0], parts[1], parts[2]];
150
+ if (parts.length === 4 && parts[2] === -(parts[0] + parts[1]))
151
+ return [parts[0], parts[1], parts[3]];
152
+ throw fail(`Unreadable Miller indices: ${printed}`);
153
+ }
154
+ /**
155
+ * The face (hkl) of printed Miller indices with the caller's values of h, k, l substituted (#137 G3):
156
+ * the printed `h,h,-2h,l` with h = 3 and l = 1 gives (3, 3, 1). The printed strings are those of
157
+ * `wyckoffPositions` and `crystalForms` (`millerIndices`), as ITA prints them: three indices, or four
158
+ * for hexagonal axes, of which i = −(h + k) is dropped, so that the face can be passed to `orbit`
159
+ * (`planeToFourIndices` gives the four). Each value is an integer; only the letters the string uses
160
+ * are needed. The face is not reduced, and whether the values keep it in its position (a general
161
+ * face (hkl) with h = k lies on a special one) is the caller's choice. Throws a RangeError for an
162
+ * unreadable string, a missing or non-integer value, an unknown key and the face (000).
163
+ */
164
+ export function millerIndices(printed, values) {
165
+ if (typeof printed !== 'string')
166
+ throw new RangeError(`millerIndices: printed Miller indices expected, not ${shown(printed)}`);
167
+ if (values === null || typeof values !== 'object' || Array.isArray(values)) {
168
+ throw new RangeError(`millerIndices: values { h, k, l } expected, not ${shown(values)}`);
169
+ }
170
+ for (const key of Object.keys(values)) {
171
+ if (!['h', 'k', 'l'].includes(key))
172
+ throw new RangeError(`millerIndices: unknown value ${shown(key)} (h, k or l)`);
173
+ }
174
+ // The own values only, each checked as it is read (an inherited or non-enumerable one included).
175
+ const own = {};
176
+ for (const letter of ['h', 'k', 'l']) {
177
+ if (!Object.hasOwn(values, letter))
178
+ continue;
179
+ const v = values[letter];
180
+ if (v === undefined)
181
+ continue;
182
+ if (!Number.isSafeInteger(v))
183
+ throw new RangeError(`millerIndices: ${letter} must be an integer, not ${shown(v)}`);
184
+ own[letter] = v;
185
+ }
186
+ // Spaces around the commas are allowed; a space inside an index is unreadable.
187
+ const hkl = substituteMillerIndices(printed, own, (m) => new RangeError(`millerIndices: ${m}`));
188
+ if (hkl.every((x) => x === 0))
189
+ throw new RangeError(`millerIndices: ${printed} gives the face (000) with ${shown(values)}`);
190
+ return deepFreeze(hkl);
100
191
  }
101
192
  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C;AACzB,CAAC"}
package/dist/lattice.d.ts CHANGED
@@ -7,8 +7,22 @@ import type { Mat3 } from './linalg.js';
7
7
  export type CrystalSystem = 'triclinic' | 'monoclinic' | 'orthorhombic' | 'tetragonal' | 'trigonal' | 'hexagonal' | 'cubic';
8
8
  /** One of the six crystal families: the trigonal and the hexagonal system form the hexagonal family. */
9
9
  export type CrystalFamily = 'triclinic' | 'monoclinic' | 'orthorhombic' | 'tetragonal' | 'hexagonal' | 'cubic';
10
- /** The crystal family of a crystal system: trigonal and hexagonal form the hexagonal family. */
10
+ /**
11
+ * The crystal family of a crystal system: trigonal and hexagonal form the hexagonal family. Throws
12
+ * a RangeError for anything that is not one of the seven crystal systems.
13
+ */
11
14
  export declare function crystalFamily(system: CrystalSystem): CrystalFamily;
15
+ /**
16
+ * One of the seven lattice systems of ITA Table 1.3.4.1 (p. 39): the lattices whose point symmetry
17
+ * is the same holohedry. The hexagonal family has two, `'hexagonal'` (hP) and `'rhombohedral'` (hR).
18
+ */
19
+ export type LatticeSystem = 'triclinic' | 'monoclinic' | 'orthorhombic' | 'tetragonal' | 'hexagonal' | 'rhombohedral' | 'cubic';
20
+ /**
21
+ * The lattice systems on which the point groups of a crystal system act (ITA § 1.3.4.4.2, p. 39):
22
+ * both of the hexagonal family for the trigonal system, which belongs to either depending on the
23
+ * basis, otherwise the one of the same name.
24
+ */
25
+ export declare function latticeSystemsOfSystem(system: CrystalSystem): readonly LatticeSystem[];
12
26
  /** The families whose cell angles are fixed, so that their lattice basis is fixed up to edge lengths. */
13
27
  export type FixedAngleFamily = 'orthorhombic' | 'tetragonal' | 'hexagonal' | 'cubic';
14
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"lattice.d.ts","sourceRoot":"","sources":["../src/lattice.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,wCAAwC;AACxC,MAAM,MAAM,aAAa,GACvB,WAAW,GAAG,Y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rF;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAW3D"}
package/dist/lattice.js CHANGED
@@ -2,10 +2,39 @@
2
2
  * Crystal systems and families, and how the conventional lattice basis sits in the Cartesian frame
3
3
  * of symcrys (docs/conventions.md, "Cartesian frame").
4
4
  */
5
- /** The crystal family of a crystal system: trigonal and hexagonal form the hexagonal family. */
5
+ import { shown } from './checks.js';
6
+ const SYSTEMS = [
7
+ 'triclinic',
8
+ 'monoclinic',
9
+ 'orthorhombic',
10
+ 'tetragonal',
11
+ 'trigonal',
12
+ 'hexagonal',
13
+ 'cubic',
14
+ ];
15
+ /**
16
+ * The crystal family of a crystal system: trigonal and hexagonal form the hexagonal family. Throws
17
+ * a RangeError for anything that is not one of the seven crystal systems.
18
+ */
6
19
  export function crystalFamily(system) {
20
+ if (!SYSTEMS.includes(system))
21
+ throw new RangeError(`Unknown crystal system: ${shown(system)}`);
7
22
  return system === 'trigonal' ? 'hexagonal' : system;
8
23
  }
24
+ /**
25
+ * The lattice systems on which the point groups of a crystal system act (ITA § 1.3.4.4.2, p. 39):
26
+ * both of the hexagonal family for the trigonal system, which belongs to either depending on the
27
+ * basis, otherwise the one of the same name.
28
+ */
29
+ export function latticeSystemsOfSystem(system) {
30
+ if (!SYSTEMS.includes(system))
31
+ throw new RangeError(`Unknown crystal system: ${shown(system)}`);
32
+ if (system === 'trigonal')
33
+ return TRIGONAL;
34
+ return LATTICE_SYSTEM_OF[system];
35
+ }
36
+ const TRIGONAL = Object.freeze(['hexagonal', 'rhombohedral']);
37
+ const LATTICE_SYSTEM_OF = Object.freeze(Object.fromEntries(['triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic'].map((s) => [s, Object.freeze([s])])));
9
38
  const S3_2 = Math.sqrt(3) / 2;
10
39
  /** A deeply frozen matrix: the apps run dist/ as plain JavaScript, where `readonly` does not hold. */
11
40
  const frozen = (m) => Object.freeze(m.map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AAC,CAAC,CACpH,CACgF,CAAC;AAKpF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAE9B,sGAAsG;AACtG,MAAM,MAAM,GAAG,CAAC,CAA6B,EAAQ,EAAE,CACrD,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAoB,CAAC;AAEvE,MAAM,WAAW,GAAG,MAAM,CAAC;IACzB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CACV,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,MAAM,CAAC;IACvB,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IACZ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACZ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CACV,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,MAAwB;IACnD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,WAAW;YACd,OAAO,SAAS,CAAC;QACnB,KAAK,cAAc,CAAC;QACpB,KAAK,YAAY,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,WAAW,CAAC;QACrB;YACE,MAAM,IAAI,UAAU,CAAC,uDAAuD,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClG,CAAC;AACH,CAAC"}
package/dist/linalg.d.ts CHANGED
@@ -21,8 +21,8 @@ export declare function rotationZ(angleDeg: number): Mat3;
21
21
  export declare function rotationX(angleDeg: number): Mat3;
22
22
  /** Proper rotation by `angleDeg` degrees about the y axis. */
23
23
  export declare function rotationY(angleDeg: number): Mat3;
24
- /** Replaces each entry within SNAP_EPSILON of an exact value by that value (this also turns −0 into 0). */
25
- export declare function snap(a: Mat3): Mat3;
24
+ /** Replaces each entry within `epsilon` (default SNAP_EPSILON) of an exact value by that value (this also turns −0 into 0). */
25
+ export declare function snap(a: Mat3, epsilon?: number): Mat3;
26
26
  /** True if all entries agree within EPSILON. */
27
27
  export declare function matricesEqual(a: Mat3, b: Mat3): boolean;
28
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"linalg.d.ts","sourceRoot":"","sources":["../src/linalg.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,0BAA0B;AAC1B,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAErD,6CAA6C;AAC7C,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE/C,eAAO,MAAM,QAAQ,EAAE,IAItB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,IAIvB,CAAC;AAWF,uBAAuB;AACvB,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAE/C;AAED,2CAA2C;AAC3C,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAM5C;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,CAEvC;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAMnC;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAErC;AAED,+FAA+F;AAC/F,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAShD;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAShD;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,QAA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ErC;AAED,+FAA+F;AAC/F,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAShD;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAShD;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAShD;AASD,+HAA+H;AAC/H,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,SAAe,GAAG,IAAI,CAM1D;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAGvD;AAUD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAI3C;AAED,sIAAsI;AACtI,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,CASrC;AAED,0DAA0D;AAC1D,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAEhD"}
package/dist/linalg.js CHANGED
@@ -83,12 +83,12 @@ export function rotationY(angleDeg) {
83
83
  * 45° setting frame (rotationZ(45), which is snapped as well).
84
84
  */
85
85
  const SNAP_VALUES = [0, 1, -1, 0.5, -0.5, Math.SQRT1_2, -Math.SQRT1_2, Math.sqrt(3) / 2, -Math.sqrt(3) / 2];
86
- /** Replaces each entry within SNAP_EPSILON of an exact value by that value (this also turns −0 into 0). */
87
- export function snap(a) {
86
+ /** Replaces each entry within `epsilon` (default SNAP_EPSILON) of an exact value by that value (this also turns −0 into 0). */
87
+ export function snap(a, epsilon = SNAP_EPSILON) {
88
88
  return build((i, j) => {
89
89
  const v = a[i][j];
90
90
  for (const s of SNAP_VALUES)
91
- if (Math.abs(v - s) < SNAP_EPSILON)
91
+ if (Math.abs(v - s) < epsilon)
92
92
  return s;
93
93
  return v;
94
94
  });
@@ -1 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AAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAClD,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAClD,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,SAAS,CAAC,CAAO,EAAE,CAAO;IACxC,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC"}
@@ -10,11 +10,12 @@
10
10
  * allows no time-odd property (docs/conventions.md, "Two entry points").
11
11
  */
12
12
  export { VERSION } from './version.js';
13
+ export { EPSILON, type ToleranceOptions } from './tolerances.js';
13
14
  export type { Mat3, Vec3 } from './linalg.js';
14
- export type { Operation } from './operations.js';
15
- export { crystalFamily, latticeBasis, type CrystalFamily, type CrystalSystem, type FixedAngleFamily, } from './lattice.js';
16
- export { angleBetweenDirections, angleBetweenPlanes, isValidCell, latticeFromParameters, latticeParameters, metricTensor, reciprocalBasis, type CellAngles, type CellOperation, type IsValidCellOptions, type LatticeParameters, type ResidualOperationsOptions, } from './cell.js';
17
- export { changeOfAxes, directionFromFourIndices, directionToFourIndices, planeFromFourIndices, planeToFourIndices, reduceIndices, zoneAxis, type AxisChange, type FourIndices, } from './indices.js';
15
+ export type { CartesianOperation, Operation } from './operations.js';
16
+ export { crystalFamily, latticeBasis, type CrystalFamily, type CrystalSystem, type FixedAngleFamily, type LatticeSystem, } from './lattice.js';
17
+ export { angleBetweenDirections, angleBetweenPlanes, faceNormal, isValidCell, latticeFromParameters, latticeParameters, metricTensor, reciprocalBasis, type CellAngles, type CellOperation, type IsValidCellOptions, type LatticeParameters, } from './cell.js';
18
+ export { changeOfAxes, directionFromFourIndices, directionToFourIndices, planeFromFourIndices, planeToFourIndices, millerIndices, reduceIndices, zoneAxis, type AxisChange, type FourIndices, type MillerValues, } from './indices.js';
18
19
  import type { PointGroupKey as ClassKey, MagneticPointGroupKey, PointGroup as PointGroupOf, PointGroupInSetting as PointGroupInSettingOf } from './pointGroups/pointGroups.js';
19
20
  /**
20
21
  * The key of a crystal class, one of the 32: the type of `crystalClass` and `laueClass` of a point
@@ -27,15 +28,16 @@ export type PointGroupKey = MagneticPointGroupKey;
27
28
  export type PointGroup<K extends PointGroupKey = PointGroupKey> = PointGroupOf<K>;
28
29
  /** A point group in a given setting. */
29
30
  export type PointGroupInSetting = PointGroupInSettingOf<PointGroupKey>;
30
- export { MAGNETIC_POINT_GROUP_KEYS as POINT_GROUP_KEYS, findMagneticPointGroup as findPointGroup, generators, isMagneticPointGroupKey as isPointGroupKey, magneticPointGroups as pointGroups, operations, pointGroup, settings, symbol, type Convention, type PointGroupType, type Setting, type SettingOptions, type SymbolOptions, } from './pointGroups/pointGroups.js';
31
- export { holohedry, isCentrosymmetricOf, isChiralOf } from './pointGroups/properties.js';
31
+ export { MAGNETIC_POINT_GROUP_KEYS as POINT_GROUP_KEYS, findMagneticPointGroup as findPointGroup, generators, isMagneticPointGroupKey as isPointGroupKey, latticeSystems, magneticPointGroups as pointGroups, operations, pointGroup, settings, symbol, type PointGroupType, type Setting, type AxesOptions, type SettingOptions, type SymbolOptions, } from './pointGroups/pointGroups.js';
32
+ export { holohedry, isCentrosymmetricOf, isEnantiomorphicOf } from './pointGroups/properties.js';
32
33
  export { LATTICE_SYMMETRY_DIRECTIONS, type Uvw } from './symmetryDirections.js';
33
34
  export { describeOperations, symmetryDirections, type Axis, type DirectionElements, type OperationDescription, type OperationKind, type SymmetryDirection, } from './pointGroups/elements.js';
34
35
  export { residualMagneticOperations as residualOperations, type MagneticCellOperation } from './cell.js';
35
- export { siteSymmetry, type SiteSymmetry, type SiteSymmetryOptions } from './siteSymmetry.js';
36
- export { describeOperationsOf, pointGroupOf, type CartesianAxis, type CartesianOperationDescription, type IdentifiedPointGroup, type PointGroupOfOptions, } from './pointGroups/identify.js';
37
- export { latticeOperations, orbit, orbitOf, type DirectionOrbitEntry, type FaceOrbitEntry, type OrbitOptions, type OrbitPole, } from './pointGroups/orbits.js';
38
- export { rotateTensor, tensorForm, tensorFormOf, type IntrinsicSymmetry, type TensorForm, type TensorParity, type TensorRank, type TensorSpec, type TimeParity, } from './tensors/tensorForm.js';
36
+ export { siteSymmetryOf, type SiteSymmetry } from './siteSymmetry.js';
37
+ export { siteSymmetry } from './pointGroups/wyckoff.js';
38
+ export { describeOperationsOf, pointGroupOf, type CartesianAxis, type CartesianOperationDescription, type IdentifiedPointGroup, } from './pointGroups/identify.js';
39
+ export { orbit, orbitOf, type DirectionIndices, type DirectionOrbitEntry, type FaceIndices, type FaceOrbitEntry, type OrbitPole, } from './pointGroups/orbits.js';
40
+ export { rotateTensor, tensorForm, tensorFormOf, type IntrinsicSymmetry, type TensorForm, type TensorKind, type TensorRank, type TensorSpec, type TimeParity, } from './tensors/tensorForm.js';
39
41
  export { TENSOR_PROPERTIES, type TensorProperty, type TensorPropertyName } from './tensors/propertyTable.js';
40
42
  export { allowedProperties, allowedPropertiesOf, allowsProperty, allowsPropertyOf, } from './tensors/tensorProperties.js';
41
43
  //# sourceMappingURL=magnetic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"magnetic.d.ts","sourceRoot":"","sources":["../src/magnetic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EACV,aAAa,IAAI,QAAQ,EACzB,qBAAqB,EACrB,UAAU,IAAI,YAAY,EAC1B,mBAAmB,IAAI,qBAAqB,EAC7C,MAAM,8BAA8B,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;AACvC,2GAA2G;AAC3G,MAAM,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAClD,uHAAuH;AACvH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAA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ACxD,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,EACL,OAAO,EACP,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,SAAS,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC7G,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,GACjB,MAAM,+BAA+B,CAAC"}
package/dist/magnetic.js CHANGED
@@ -10,17 +10,19 @@
10
10
  * allows no time-odd property (docs/conventions.md, "Two entry points").
11
11
  */
12
12
  export { VERSION } from './version.js';
13
+ export { EPSILON } from './tolerances.js';
13
14
  export { crystalFamily, latticeBasis, } from './lattice.js';
14
- export { angleBetweenDirections, angleBetweenPlanes, isValidCell, latticeFromParameters, latticeParameters, metricTensor, reciprocalBasis, } from './cell.js';
15
- export { changeOfAxes, directionFromFourIndices, directionToFourIndices, planeFromFourIndices, planeToFourIndices, reduceIndices, zoneAxis, } from './indices.js';
16
- export { MAGNETIC_POINT_GROUP_KEYS as POINT_GROUP_KEYS, findMagneticPointGroup as findPointGroup, generators, isMagneticPointGroupKey as isPointGroupKey, magneticPointGroups as pointGroups, operations, pointGroup, settings, symbol, } from './pointGroups/pointGroups.js';
17
- export { holohedry, isCentrosymmetricOf, isChiralOf } from './pointGroups/properties.js';
15
+ export { angleBetweenDirections, angleBetweenPlanes, faceNormal, isValidCell, latticeFromParameters, latticeParameters, metricTensor, reciprocalBasis, } from './cell.js';
16
+ export { changeOfAxes, directionFromFourIndices, directionToFourIndices, planeFromFourIndices, planeToFourIndices, millerIndices, reduceIndices, zoneAxis, } from './indices.js';
17
+ export { MAGNETIC_POINT_GROUP_KEYS as POINT_GROUP_KEYS, findMagneticPointGroup as findPointGroup, generators, isMagneticPointGroupKey as isPointGroupKey, latticeSystems, magneticPointGroups as pointGroups, operations, pointGroup, settings, symbol, } from './pointGroups/pointGroups.js';
18
+ export { holohedry, isCentrosymmetricOf, isEnantiomorphicOf } from './pointGroups/properties.js';
18
19
  export { LATTICE_SYMMETRY_DIRECTIONS } from './symmetryDirections.js';
19
20
  export { describeOperations, symmetryDirections, } from './pointGroups/elements.js';
20
21
  export { residualMagneticOperations as residualOperations } from './cell.js';
21
- export { siteSymmetry } from './siteSymmetry.js';
22
+ export { siteSymmetryOf } from './siteSymmetry.js';
23
+ export { siteSymmetry } from './pointGroups/wyckoff.js';
22
24
  export { describeOperationsOf, pointGroupOf, } from './pointGroups/identify.js';
23
- export { latticeOperations, orbit, orbitOf, } from './pointGroups/orbits.js';
25
+ export { orbit, orbitOf, } from './pointGroups/orbits.js';
24
26
  export { rotateTensor, tensorForm, tensorFormOf, } from './tensors/tensorForm.js';
25
27
  export { TENSOR_PROPERTIES } from './tensors/propertyTable.js';
26
28
  export { allowedProperties, allowedPropertiesOf, allowsProperty, allowsPropertyOf, } from './tensors/tensorProperties.js';