@ac-kit/math-linear 0.2.0 → 0.3.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 (178) hide show
  1. package/CHANGELOG.md +268 -0
  2. package/README.md +229 -16
  3. package/dist/_brand.d.ts +14 -0
  4. package/dist/_brand.d.ts.map +1 -0
  5. package/dist/_brand.js +2 -0
  6. package/dist/_brand.js.map +1 -0
  7. package/dist/_invert.d.ts +19 -0
  8. package/dist/_invert.d.ts.map +1 -0
  9. package/dist/_invert.js +48 -0
  10. package/dist/_invert.js.map +1 -0
  11. package/dist/_slerp.d.ts +15 -0
  12. package/dist/_slerp.d.ts.map +1 -1
  13. package/dist/_slerp.js +47 -0
  14. package/dist/_slerp.js.map +1 -1
  15. package/dist/_strided-range.d.ts +23 -0
  16. package/dist/_strided-range.d.ts.map +1 -0
  17. package/dist/_strided-range.js +75 -0
  18. package/dist/_strided-range.js.map +1 -0
  19. package/dist/_trs.d.ts +38 -0
  20. package/dist/_trs.d.ts.map +1 -0
  21. package/dist/_trs.js +132 -0
  22. package/dist/_trs.js.map +1 -0
  23. package/dist/affine2-array.d.ts +53 -0
  24. package/dist/affine2-array.d.ts.map +1 -0
  25. package/dist/affine2-array.js +107 -0
  26. package/dist/affine2-array.js.map +1 -0
  27. package/dist/affine2-componentwise.d.ts +28 -0
  28. package/dist/affine2-componentwise.d.ts.map +1 -0
  29. package/dist/affine2-componentwise.js +66 -0
  30. package/dist/affine2-componentwise.js.map +1 -0
  31. package/dist/affine2.d.ts +144 -0
  32. package/dist/affine2.d.ts.map +1 -0
  33. package/dist/affine2.js +375 -0
  34. package/dist/affine2.js.map +1 -0
  35. package/dist/affine3-array.d.ts +53 -0
  36. package/dist/affine3-array.d.ts.map +1 -0
  37. package/dist/affine3-array.js +137 -0
  38. package/dist/affine3-array.js.map +1 -0
  39. package/dist/affine3-componentwise.d.ts +32 -0
  40. package/dist/affine3-componentwise.d.ts.map +1 -0
  41. package/dist/affine3-componentwise.js +100 -0
  42. package/dist/affine3-componentwise.js.map +1 -0
  43. package/dist/affine3.d.ts +192 -0
  44. package/dist/affine3.d.ts.map +1 -0
  45. package/dist/affine3.js +718 -0
  46. package/dist/affine3.js.map +1 -0
  47. package/dist/checked/index.d.ts +35 -0
  48. package/dist/checked/index.d.ts.map +1 -0
  49. package/dist/checked/index.js +58 -0
  50. package/dist/checked/index.js.map +1 -0
  51. package/dist/euler.d.ts +65 -0
  52. package/dist/euler.d.ts.map +1 -0
  53. package/dist/euler.js +217 -0
  54. package/dist/euler.js.map +1 -0
  55. package/dist/index.d.ts +29 -0
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +29 -0
  58. package/dist/index.js.map +1 -1
  59. package/dist/kl-activations.d.ts.map +1 -1
  60. package/dist/kl-activations.js +4 -3
  61. package/dist/kl-activations.js.map +1 -1
  62. package/dist/mat2x2-array.d.ts +36 -0
  63. package/dist/mat2x2-array.d.ts.map +1 -0
  64. package/dist/mat2x2-array.js +71 -0
  65. package/dist/mat2x2-array.js.map +1 -0
  66. package/dist/mat2x2-componentwise.d.ts +86 -0
  67. package/dist/mat2x2-componentwise.d.ts.map +1 -0
  68. package/dist/mat2x2-componentwise.js +199 -0
  69. package/dist/mat2x2-componentwise.js.map +1 -0
  70. package/dist/mat2x2.d.ts +67 -25
  71. package/dist/mat2x2.d.ts.map +1 -1
  72. package/dist/mat2x2.js +150 -94
  73. package/dist/mat2x2.js.map +1 -1
  74. package/dist/mat3x3-array.d.ts +36 -0
  75. package/dist/mat3x3-array.d.ts.map +1 -0
  76. package/dist/mat3x3-array.js +91 -0
  77. package/dist/mat3x3-array.js.map +1 -0
  78. package/dist/mat3x3-componentwise.d.ts +86 -0
  79. package/dist/mat3x3-componentwise.d.ts.map +1 -0
  80. package/dist/mat3x3-componentwise.js +299 -0
  81. package/dist/mat3x3-componentwise.js.map +1 -0
  82. package/dist/mat3x3.d.ts +131 -48
  83. package/dist/mat3x3.d.ts.map +1 -1
  84. package/dist/mat3x3.js +434 -193
  85. package/dist/mat3x3.js.map +1 -1
  86. package/dist/mat4x4-array.d.ts +46 -0
  87. package/dist/mat4x4-array.d.ts.map +1 -0
  88. package/dist/mat4x4-array.js +133 -0
  89. package/dist/mat4x4-array.js.map +1 -0
  90. package/dist/mat4x4-componentwise.d.ts +87 -0
  91. package/dist/mat4x4-componentwise.d.ts.map +1 -0
  92. package/dist/mat4x4-componentwise.js +434 -0
  93. package/dist/mat4x4-componentwise.js.map +1 -0
  94. package/dist/mat4x4.d.ts +195 -67
  95. package/dist/mat4x4.d.ts.map +1 -1
  96. package/dist/mat4x4.js +849 -335
  97. package/dist/mat4x4.js.map +1 -1
  98. package/dist/projection.d.ts +98 -0
  99. package/dist/projection.d.ts.map +1 -0
  100. package/dist/projection.js +369 -0
  101. package/dist/projection.js.map +1 -0
  102. package/dist/quaternion-array.d.ts +47 -0
  103. package/dist/quaternion-array.d.ts.map +1 -0
  104. package/dist/quaternion-array.js +86 -0
  105. package/dist/quaternion-array.js.map +1 -0
  106. package/dist/quaternion.d.ts +104 -22
  107. package/dist/quaternion.d.ts.map +1 -1
  108. package/dist/quaternion.js +294 -181
  109. package/dist/quaternion.js.map +1 -1
  110. package/dist/transform.d.ts +220 -0
  111. package/dist/transform.d.ts.map +1 -0
  112. package/dist/transform.js +412 -0
  113. package/dist/transform.js.map +1 -0
  114. package/dist/tridiagonal.d.ts +52 -0
  115. package/dist/tridiagonal.d.ts.map +1 -0
  116. package/dist/tridiagonal.js +90 -0
  117. package/dist/tridiagonal.js.map +1 -0
  118. package/dist/upload.d.ts +55 -0
  119. package/dist/upload.d.ts.map +1 -0
  120. package/dist/upload.js +129 -0
  121. package/dist/upload.js.map +1 -0
  122. package/dist/vec2-array-componentwise.d.ts +189 -0
  123. package/dist/vec2-array-componentwise.d.ts.map +1 -0
  124. package/dist/vec2-array-componentwise.js +424 -0
  125. package/dist/vec2-array-componentwise.js.map +1 -0
  126. package/dist/vec2-array.d.ts +53 -0
  127. package/dist/vec2-array.d.ts.map +1 -0
  128. package/dist/vec2-array.js +123 -0
  129. package/dist/vec2-array.js.map +1 -0
  130. package/dist/vec2-componentwise.d.ts +311 -0
  131. package/dist/vec2-componentwise.d.ts.map +1 -0
  132. package/dist/vec2-componentwise.js +542 -0
  133. package/dist/vec2-componentwise.js.map +1 -0
  134. package/dist/vec2.d.ts +97 -82
  135. package/dist/vec2.d.ts.map +1 -1
  136. package/dist/vec2.js +121 -216
  137. package/dist/vec2.js.map +1 -1
  138. package/dist/vec3-array-componentwise.d.ts +189 -0
  139. package/dist/vec3-array-componentwise.d.ts.map +1 -0
  140. package/dist/vec3-array-componentwise.js +458 -0
  141. package/dist/vec3-array-componentwise.js.map +1 -0
  142. package/dist/vec3-array.d.ts +102 -0
  143. package/dist/vec3-array.d.ts.map +1 -0
  144. package/dist/vec3-array.js +299 -0
  145. package/dist/vec3-array.js.map +1 -0
  146. package/dist/vec3-componentwise.d.ts +310 -0
  147. package/dist/vec3-componentwise.d.ts.map +1 -0
  148. package/dist/vec3-componentwise.js +594 -0
  149. package/dist/vec3-componentwise.js.map +1 -0
  150. package/dist/vec3.d.ts +177 -87
  151. package/dist/vec3.d.ts.map +1 -1
  152. package/dist/vec3.js +366 -273
  153. package/dist/vec3.js.map +1 -1
  154. package/dist/vec4-array-componentwise.d.ts +155 -0
  155. package/dist/vec4-array-componentwise.d.ts.map +1 -0
  156. package/dist/vec4-array-componentwise.js +401 -0
  157. package/dist/vec4-array-componentwise.js.map +1 -0
  158. package/dist/vec4-array.d.ts +12 -0
  159. package/dist/vec4-array.d.ts.map +1 -0
  160. package/dist/vec4-array.js +43 -0
  161. package/dist/vec4-array.js.map +1 -0
  162. package/dist/vec4-componentwise.d.ts +299 -0
  163. package/dist/vec4-componentwise.d.ts.map +1 -0
  164. package/dist/vec4-componentwise.js +637 -0
  165. package/dist/vec4-componentwise.js.map +1 -0
  166. package/dist/vec4.d.ts +57 -53
  167. package/dist/vec4.d.ts.map +1 -1
  168. package/dist/vec4.js +94 -246
  169. package/dist/vec4.js.map +1 -1
  170. package/dist/view-basis.d.ts +15 -0
  171. package/dist/view-basis.d.ts.map +1 -0
  172. package/dist/view-basis.js +29 -0
  173. package/dist/view-basis.js.map +1 -0
  174. package/dist/viewport.d.ts +114 -0
  175. package/dist/viewport.d.ts.map +1 -0
  176. package/dist/viewport.js +250 -0
  177. package/dist/viewport.js.map +1 -0
  178. package/package.json +18 -9
@@ -0,0 +1,137 @@
1
+ // Generated from scripts/templates/value-array.liquid by scripts/generate-componentwise.ts. Do not edit.
2
+ import { assertInteger } from "@ac-kit/core";
3
+ /**
4
+ * Creates a buffer for `count` affine3 elements: a zero-filled `Float64Array`
5
+ * of `count × 12` numbers, element `i` at `[i·12, i·12 + 12)`, a zero element
6
+ * being the all-zero transform (use {@link affine3Store} with the identity to
7
+ * fill it with identities). Allocates.
8
+ *
9
+ * @throws {RangeError} When `count` is not a non-negative safe integer or
10
+ * `count × 12` is not a valid typed array length.
11
+ */
12
+ export function affine3ArrayCreate(count) {
13
+ assertInteger(count, "affine3ArrayCreate: count", 0);
14
+ return new Float64Array(count * 12);
15
+ }
16
+ /**
17
+ * Writes element `index` of `array`, the numbers at `[index·12, index·12 +
18
+ * 12)`, into `out`. Each component is written as `+array[i]`, so an index past
19
+ * the end of `array` gives `NaN`, never `undefined`: the transform stays clean
20
+ * whatever the caller does. Checking the index is the job of the checked
21
+ * layer.
22
+ *
23
+ * The transform is copied: it is never a view of `array`. O(1).
24
+ */
25
+ export function affine3Load(out, array, index) {
26
+ const base = index * 12;
27
+ // The `!` is for the compiler: past the end `+undefined` is `NaN`.
28
+ out[0] = +array[base];
29
+ out[1] = +array[base + 1];
30
+ out[2] = +array[base + 2];
31
+ out[3] = +array[base + 3];
32
+ out[4] = +array[base + 4];
33
+ out[5] = +array[base + 5];
34
+ out[6] = +array[base + 6];
35
+ out[7] = +array[base + 7];
36
+ out[8] = +array[base + 8];
37
+ out[9] = +array[base + 9];
38
+ out[10] = +array[base + 10];
39
+ out[11] = +array[base + 11];
40
+ return out;
41
+ }
42
+ /**
43
+ * Writes `value` into `array` as element `index`, at `[index·12, index·12 +
44
+ * 12)`. An element past the end of `array` writes nothing, as a typed array
45
+ * drops an out-of-range write. O(1).
46
+ */
47
+ export function affine3Store(array, index, value) {
48
+ const base = index * 12;
49
+ array[base] = value[0];
50
+ array[base + 1] = value[1];
51
+ array[base + 2] = value[2];
52
+ array[base + 3] = value[3];
53
+ array[base + 4] = value[4];
54
+ array[base + 5] = value[5];
55
+ array[base + 6] = value[6];
56
+ array[base + 7] = value[7];
57
+ array[base + 8] = value[8];
58
+ array[base + 9] = value[9];
59
+ array[base + 10] = value[10];
60
+ array[base + 11] = value[11];
61
+ }
62
+ /**
63
+ * Like {@link affine3Load} for interleaved data: element `index` starts at
64
+ * `offset + index·stride`, both counted in numbers, and its 12 components
65
+ * follow one another. An index past the end gives `NaN` components. O(1).
66
+ */
67
+ export function affine3LoadStrided(out, array, offset, stride, index) {
68
+ const base = offset + index * stride;
69
+ // The `!` is for the compiler: past the end `+undefined` is `NaN`.
70
+ out[0] = +array[base];
71
+ out[1] = +array[base + 1];
72
+ out[2] = +array[base + 2];
73
+ out[3] = +array[base + 3];
74
+ out[4] = +array[base + 4];
75
+ out[5] = +array[base + 5];
76
+ out[6] = +array[base + 6];
77
+ out[7] = +array[base + 7];
78
+ out[8] = +array[base + 8];
79
+ out[9] = +array[base + 9];
80
+ out[10] = +array[base + 10];
81
+ out[11] = +array[base + 11];
82
+ return out;
83
+ }
84
+ /**
85
+ * Like {@link affine3Store} for interleaved data: element `index` starts at
86
+ * `offset + index·stride`, both counted in numbers. A component past the end of
87
+ * `array` writes nothing. O(1).
88
+ */
89
+ export function affine3StoreStrided(array, offset, stride, index, value) {
90
+ const base = offset + index * stride;
91
+ array[base] = value[0];
92
+ array[base + 1] = value[1];
93
+ array[base + 2] = value[2];
94
+ array[base + 3] = value[3];
95
+ array[base + 4] = value[4];
96
+ array[base + 5] = value[5];
97
+ array[base + 6] = value[6];
98
+ array[base + 7] = value[7];
99
+ array[base + 8] = value[8];
100
+ array[base + 9] = value[9];
101
+ array[base + 10] = value[10];
102
+ array[base + 11] = value[11];
103
+ }
104
+ /**
105
+ * Narrows `value` to binary32 and writes its 12 components into `array` from
106
+ * element `offset` on, unrolled: the way to stage a vertex, instance or uniform
107
+ * value for the GPU, where `array.set` costs several times as much for one
108
+ * value. A component past the end of `array` writes nothing. O(1).
109
+ */
110
+ export function affine3StoreFloat32(array, offset, value) {
111
+ array[offset] = value[0];
112
+ array[offset + 1] = value[1];
113
+ array[offset + 2] = value[2];
114
+ array[offset + 3] = value[3];
115
+ array[offset + 4] = value[4];
116
+ array[offset + 5] = value[5];
117
+ array[offset + 6] = value[6];
118
+ array[offset + 7] = value[7];
119
+ array[offset + 8] = value[8];
120
+ array[offset + 9] = value[9];
121
+ array[offset + 10] = value[10];
122
+ array[offset + 11] = value[11];
123
+ }
124
+ /**
125
+ * Whether every number of `array` is finite: the check for a buffer of affine3
126
+ * elements read from untrusted data or about to be uploaded. The length is not
127
+ * required to be a multiple of 12 (see `assertFiniteBuffer` for that). O(n).
128
+ */
129
+ export function affine3ArrayIsFinite(array) {
130
+ for (let index = 0; index < array.length; index++) {
131
+ if (!Number.isFinite(array[index])) {
132
+ return false;
133
+ }
134
+ }
135
+ return true;
136
+ }
137
+ //# sourceMappingURL=affine3-array.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"affine3-array.js","sourceRoot":"","sources":["../src/affine3-array.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAEzG,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC/C,aAAa,CAAC,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC,CAAC;IACrD,OAAO,IAAI,YAAY,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;G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AAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/B,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAmB;IACvD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACpC,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type IsCloseToOptions } from "@ac-kit/core";
2
+ import type { ReadonlyAffine3, Affine3 } from "./affine3.js";
3
+ /**
4
+ * Writes the entries in storage order into `out`: the columns of the matrix one
5
+ * after the other, `m00, m10, m20` being the x axis and `m03, m13, m23` the
6
+ * translation.
7
+ */
8
+ export declare function affine3Set(out: Affine3, m00: number, m10: number, m20: number, m01: number, m11: number, m21: number, m02: number, m12: number, m22: number, m03: number, m13: number, m23: number): Affine3;
9
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
10
+ export declare function affine3Copy(out: Affine3, a: ReadonlyAffine3): Affine3;
11
+ /**
12
+ * Writes the identity transform `[1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]` into
13
+ * `out`.
14
+ */
15
+ export declare function affine3Identity(out: Affine3): Affine3;
16
+ /**
17
+ * Exact entry-wise equality: `−0` equals `+0`, and `NaN` equals nothing, itself
18
+ * included. See {@link affine3IsClose} for a tolerant test.
19
+ */
20
+ export declare function affine3Equals(a: ReadonlyAffine3, b: ReadonlyAffine3): boolean;
21
+ /**
22
+ * Entry-wise approximate equality, each pair compared by `@ac-kit/core`'s
23
+ * `isCloseTo` with `options`: none means exact.
24
+ *
25
+ * Not transitive, so it is not an equality in the sense a `Set` or `Map` needs,
26
+ * and never a basis for ordering — use {@link affine3Equals} there. The
27
+ * tolerance is required: a transform carries no units of its own, so only the
28
+ * caller knows what counts as close (and the same tolerance covers a matrix
29
+ * entry and a translation).
30
+ */
31
+ export declare function affine3IsClose(a: ReadonlyAffine3, b: ReadonlyAffine3, options: IsCloseToOptions): boolean;
32
+ //# sourceMappingURL=affine3-componentwise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"affine3-componentwise.d.ts","sourceRoot":"","sources":["../src/affine3-componentwise.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,UAAU,CACzB,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,OAAO,CAcT;AAED,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,eAAe,GAAG,OAAO,CAcrE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAcrD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,GAAG,OAAO,CAe7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC7B,CAAC,EAAE,eAAe,EAClB,CAAC,EAAE,eAAe,EAClB,OAAO,EAAE,gBAAgB,GACvB,OAAO,CAeT"}
@@ -0,0 +1,100 @@
1
+ // Generated from scripts/templates/affine-componentwise.liquid by scripts/generate-componentwise.ts. Do not edit.
2
+ import { isCloseTo } from "@ac-kit/core";
3
+ /**
4
+ * Writes the entries in storage order into `out`: the columns of the matrix one
5
+ * after the other, `m00, m10, m20` being the x axis and `m03, m13, m23` the
6
+ * translation.
7
+ */
8
+ export function affine3Set(out, m00, m10, m20, m01, m11, m21, m02, m12, m22, m03, m13, m23) {
9
+ out[0] = m00;
10
+ out[1] = m10;
11
+ out[2] = m20;
12
+ out[3] = m01;
13
+ out[4] = m11;
14
+ out[5] = m21;
15
+ out[6] = m02;
16
+ out[7] = m12;
17
+ out[8] = m22;
18
+ out[9] = m03;
19
+ out[10] = m13;
20
+ out[11] = m23;
21
+ return out;
22
+ }
23
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
24
+ export function affine3Copy(out, a) {
25
+ out[0] = a[0];
26
+ out[1] = a[1];
27
+ out[2] = a[2];
28
+ out[3] = a[3];
29
+ out[4] = a[4];
30
+ out[5] = a[5];
31
+ out[6] = a[6];
32
+ out[7] = a[7];
33
+ out[8] = a[8];
34
+ out[9] = a[9];
35
+ out[10] = a[10];
36
+ out[11] = a[11];
37
+ return out;
38
+ }
39
+ /**
40
+ * Writes the identity transform `[1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]` into
41
+ * `out`.
42
+ */
43
+ export function affine3Identity(out) {
44
+ out[0] = 1;
45
+ out[1] = 0;
46
+ out[2] = 0;
47
+ out[3] = 0;
48
+ out[4] = 1;
49
+ out[5] = 0;
50
+ out[6] = 0;
51
+ out[7] = 0;
52
+ out[8] = 1;
53
+ out[9] = 0;
54
+ out[10] = 0;
55
+ out[11] = 0;
56
+ return out;
57
+ }
58
+ /**
59
+ * Exact entry-wise equality: `−0` equals `+0`, and `NaN` equals nothing, itself
60
+ * included. See {@link affine3IsClose} for a tolerant test.
61
+ */
62
+ export function affine3Equals(a, b) {
63
+ return (a[0] === b[0] &&
64
+ a[1] === b[1] &&
65
+ a[2] === b[2] &&
66
+ a[3] === b[3] &&
67
+ a[4] === b[4] &&
68
+ a[5] === b[5] &&
69
+ a[6] === b[6] &&
70
+ a[7] === b[7] &&
71
+ a[8] === b[8] &&
72
+ a[9] === b[9] &&
73
+ a[10] === b[10] &&
74
+ a[11] === b[11]);
75
+ }
76
+ /**
77
+ * Entry-wise approximate equality, each pair compared by `@ac-kit/core`'s
78
+ * `isCloseTo` with `options`: none means exact.
79
+ *
80
+ * Not transitive, so it is not an equality in the sense a `Set` or `Map` needs,
81
+ * and never a basis for ordering — use {@link affine3Equals} there. The
82
+ * tolerance is required: a transform carries no units of its own, so only the
83
+ * caller knows what counts as close (and the same tolerance covers a matrix
84
+ * entry and a translation).
85
+ */
86
+ export function affine3IsClose(a, b, options) {
87
+ return (isCloseTo(a[0], b[0], options) &&
88
+ isCloseTo(a[1], b[1], options) &&
89
+ isCloseTo(a[2], b[2], options) &&
90
+ isCloseTo(a[3], b[3], options) &&
91
+ isCloseTo(a[4], b[4], options) &&
92
+ isCloseTo(a[5], b[5], options) &&
93
+ isCloseTo(a[6], b[6], options) &&
94
+ isCloseTo(a[7], b[7], options) &&
95
+ isCloseTo(a[8], b[8], options) &&
96
+ isCloseTo(a[9], b[9], options) &&
97
+ isCloseTo(a[10], b[10], options) &&
98
+ isCloseTo(a[11], b[11], options));
99
+ }
100
+ //# sourceMappingURL=affine3-componentwise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"affine3-componentwise.js","sourceRoot":"","sources":["../src/affine3-componentwise.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAElH,OAAO,EAAE,SAAS,EAAyB,MAAM,cAAc,CAAC;AAIhE;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACzB,GAAY,EACZ,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW;IAEX,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACb,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;IACd,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;IACd,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,WAAW,CAAC,GAAY,EAAE,CAAkB;IAC3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AS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC;QAChC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAChC,CAAC;AACH,CAAC"}
@@ -0,0 +1,192 @@
1
+ import type { Quaternion, ReadonlyQuaternion } from "@ac-kit/math-complex";
2
+ import type { Brand_ } from "./_brand.js";
3
+ import type { ReadonlyMat3x3 } from "./mat3x3.js";
4
+ import type { ReadonlyMat4x4 } from "./mat4x4.js";
5
+ import type { ReadonlyVec3, Vec3 } from "./vec3.js";
6
+ /**
7
+ * A 3D affine transform: four columns of three, the x axis, the y axis, the z
8
+ * axis and the translation, the 4 × 4 matrix without its bottom row `0, 0, 0,
9
+ * 1` (a WGSL `mat4x3f`), so the translation sits at 9, 10 and 11. A plain array
10
+ * of twelve binary64 numbers carrying a type-level brand; a buffer of them is a
11
+ * `Float64Array` of `count × 12` numbers.
12
+ *
13
+ * Only {@link affine3Create}, {@link affine3Of}, {@link affine3OfRows},
14
+ * {@link affine3Clone}, {@link affine3FromArray} and the functions that write an
15
+ * `out` make one; see {@link Vec3} for the rules that bind callers who bypass
16
+ * the types.
17
+ */
18
+ export type Affine3 = [
19
+ m00: number,
20
+ m10: number,
21
+ m20: number,
22
+ m01: number,
23
+ m11: number,
24
+ m21: number,
25
+ m02: number,
26
+ m12: number,
27
+ m22: number,
28
+ m03: number,
29
+ m13: number,
30
+ m23: number
31
+ ] & Brand_<"Affine3">;
32
+ /** An {@link Affine3} that is only read. */
33
+ export type ReadonlyAffine3 = readonly [
34
+ m00: number,
35
+ m10: number,
36
+ m20: number,
37
+ m01: number,
38
+ m11: number,
39
+ m21: number,
40
+ m02: number,
41
+ m12: number,
42
+ m22: number,
43
+ m03: number,
44
+ m13: number,
45
+ m23: number
46
+ ] & Brand_<"Affine3">;
47
+ /**
48
+ * Creates the identity transform.
49
+ *
50
+ * Allocates; keep it out of hot loops.
51
+ */
52
+ export declare function affine3Create(): Affine3;
53
+ /**
54
+ * Creates the transform with the entries in storage order, the columns one
55
+ * after the other: `m00, m10, m20` is the x axis, `m03, m13, m23` the
56
+ * translation.
57
+ *
58
+ * Allocates; keep it out of hot loops.
59
+ */
60
+ export declare function affine3Of(m00: number, m10: number, m20: number, m01: number, m11: number, m21: number, m02: number, m12: number, m22: number, m03: number, m13: number, m23: number): Affine3;
61
+ /**
62
+ * Creates the transform from the three rows of its 3 × 4 matrix, written as in
63
+ * a textbook: `m00, m01, m02, m03` is the first row, whose last entry is the x
64
+ * translation.
65
+ *
66
+ * Allocates; keep it out of hot loops.
67
+ */
68
+ export declare function affine3OfRows(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number): Affine3;
69
+ /**
70
+ * Creates a copy of `a`. Like every creator it starts from a clean array.
71
+ *
72
+ * Allocates; keep it out of hot loops.
73
+ */
74
+ export declare function affine3Clone(a: ReadonlyAffine3): Affine3;
75
+ /**
76
+ * The checked way in from untyped data (JSON, messages, arrays of unknown
77
+ * origin): `source[offset … offset + 12)` copied into `out`, each element that
78
+ * is not a number written as `NaN`, an index past the end of `source` too, so
79
+ * `out` never holds a non-number. A cold path. O(1).
80
+ *
81
+ * `source` may be `out` itself: the twelve elements are read before the first
82
+ * write.
83
+ *
84
+ * @param out The transform to fill.
85
+ * @param source The array to read, of any length and any content.
86
+ * @param offset The index of the first entry in `source`.
87
+ * @returns `out`.
88
+ */
89
+ export declare function affine3FromArray(out: Affine3, source: ArrayLike<number>, offset?: number): Affine3;
90
+ /**
91
+ * Whether every entry is a finite number: the check to run after parsing
92
+ * untrusted data or before an upload, as operations never check. An entry that
93
+ * is not a number at all counts as not finite.
94
+ */
95
+ export declare function affine3IsFinite(a: ReadonlyAffine3): boolean;
96
+ /**
97
+ * Writes the composition `a · b` into `out`: `b` is applied first, then `a`.
98
+ * Not commutative. Plain arithmetic, straight-line: the entries of the product
99
+ * of the two 4 × 4 matrices that these stand for, without the bottom row's
100
+ * zeros. `out` may be `a` or `b`.
101
+ */
102
+ export declare function affine3Multiply(out: Affine3, a: ReadonlyAffine3, b: ReadonlyAffine3): Affine3;
103
+ /**
104
+ * The determinant of the linear part: the signed volume scale of the transform,
105
+ * negative for a reflection. Plain arithmetic.
106
+ */
107
+ export declare function affine3Determinant(a: ReadonlyAffine3): number;
108
+ /**
109
+ * Writes the inverse transform of `a` into `out` and returns `true`. When the
110
+ * determinant of the linear part is zero or not finite, or the inverse does not
111
+ * fit in binary64, the transform has no usable inverse: `out` is filled with
112
+ * `NaN` and the result is `false`: `true` always comes with a finite `out`,
113
+ * never a stale or partial transform, and nothing throws. A transform whose
114
+ * linear part is of one very large or very small magnitude, whose determinant
115
+ * overflows or underflows, is inverted all the same (a uniform scale of
116
+ * `1e-100` gives `1e100`), by scaling the linear part by a power of two first.
117
+ * Plain arithmetic (the adjugate over the determinant). `out` may be `a`.
118
+ */
119
+ export declare function affine3Invert(out: Affine3, a: ReadonlyAffine3): boolean;
120
+ /** Writes the translation by `translation` into `out`. */
121
+ export declare function affine3FromTranslation(out: Affine3, translation: ReadonlyVec3): Affine3;
122
+ /** Writes the scale `diag(scale)` into `out`. */
123
+ export declare function affine3FromScale(out: Affine3, scale: ReadonlyVec3): Affine3;
124
+ /**
125
+ * Writes the rotation by `angle` radians about the x axis (right-hand rule)
126
+ * into `out`.
127
+ */
128
+ export declare function affine3FromRotationX(out: Affine3, angle: number): Affine3;
129
+ /**
130
+ * Writes the rotation by `angle` radians about the y axis (right-hand rule)
131
+ * into `out`.
132
+ */
133
+ export declare function affine3FromRotationY(out: Affine3, angle: number): Affine3;
134
+ /**
135
+ * Writes the rotation by `angle` radians about the z axis (right-hand rule)
136
+ * into `out`.
137
+ */
138
+ export declare function affine3FromRotationZ(out: Affine3, angle: number): Affine3;
139
+ /**
140
+ * Writes the rotation by `angle` radians about the unit vector `axis`
141
+ * (right-hand rule, Rodrigues' formula) into `out`. `axis` is not normalised
142
+ * here: for any other length the matrix is not a rotation.
143
+ */
144
+ export declare function affine3FromAxisAngle(out: Affine3, axis: ReadonlyVec3, angle: number): Affine3;
145
+ /**
146
+ * Writes the rotation of the unit quaternion `q`, with no translation, into
147
+ * `out`. `q` must be unit length; it is not normalised here.
148
+ */
149
+ export declare function affine3FromQuaternion(out: Affine3, q: ReadonlyQuaternion): Affine3;
150
+ /** Writes the 3 × 3 matrix `m` as a transform with no translation into `out`. */
151
+ export declare function affine3FromMat3x3(out: Affine3, m: ReadonlyMat3x3): Affine3;
152
+ /**
153
+ * Writes the upper three rows of `m` into `out`, dropping its bottom row, which
154
+ * an {@link Affine3} does not store (`0, 0, 0, 1` for an affine matrix). A
155
+ * perspective row is lost.
156
+ */
157
+ export declare function affine3FromMat4x4(out: Affine3, m: ReadonlyMat4x4): Affine3;
158
+ /**
159
+ * Writes the transform that scales, then rotates, then translates into `out`:
160
+ * `T · R · S`, with `rotation` a unit quaternion (not normalised here).
161
+ */
162
+ export declare function affine3Compose(out: Affine3, translation: ReadonlyVec3, rotation: ReadonlyQuaternion, scale: ReadonlyVec3): Affine3;
163
+ /**
164
+ * Splits `a` into the translation, rotation and scale that
165
+ * {@link affine3Compose} builds it from: the translation is the last column, the
166
+ * scale is the length of each of the other three, and the rotation is the unit
167
+ * quaternion of those columns divided by it. A reflection (negative
168
+ * determinant) puts its sign in the x scale, so the rotation is proper.
169
+ *
170
+ * Returns `false` when there is no such split: a column of zero length or not
171
+ * finite, two columns further from perpendicular than about `1e-6` in cosine (a
172
+ * shear), or a translation that is not finite. The three outputs then hold
173
+ * `NaN`, never a stale or partial result, and nothing throws.
174
+ */
175
+ export declare function affine3Decompose(outTranslation: Vec3, outRotation: Quaternion, outScale: Vec3, a: ReadonlyAffine3): boolean;
176
+ /**
177
+ * Writes `a · T(translation)` into `out`: the translation applied first, in the
178
+ * local space of `a`. Only the translation column changes. `out` may be `a`.
179
+ */
180
+ export declare function affine3Translate(out: Affine3, a: ReadonlyAffine3, translation: ReadonlyVec3): Affine3;
181
+ /**
182
+ * Writes `a · R(rotation)` into `out`: the rotation of the unit quaternion
183
+ * `rotation` applied first, in the local space of `a` (`rotation` is not
184
+ * normalised here). The translation does not change. `out` may be `a`.
185
+ */
186
+ export declare function affine3Rotate(out: Affine3, a: ReadonlyAffine3, rotation: ReadonlyQuaternion): Affine3;
187
+ /**
188
+ * Writes `a · S(scale)` into `out`: the scale applied first, in the local space
189
+ * of `a`. The translation does not change. `out` may be `a`.
190
+ */
191
+ export declare function affine3Scale(out: Affine3, a: ReadonlyAffine3, scale: ReadonlyVec3): Affine3;
192
+ //# sourceMapping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