linearly 0.36.0 → 0.37.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 (47) hide show
  1. package/lib/esm/mat2.d.ts +1 -1
  2. package/lib/esm/mat2.d.ts.map +1 -1
  3. package/lib/esm/mat2.js +3 -2
  4. package/lib/esm/mat2d.d.ts.map +1 -1
  5. package/lib/esm/mat2d.js +4 -5
  6. package/lib/esm/mat3.d.ts.map +1 -1
  7. package/lib/esm/mat3.js +16 -15
  8. package/lib/esm/mat4.d.ts.map +1 -1
  9. package/lib/esm/mat4.js +18 -17
  10. package/lib/esm/quat.js +3 -3
  11. package/lib/esm/scalar.d.ts +6 -35
  12. package/lib/esm/scalar.d.ts.map +1 -1
  13. package/lib/esm/scalar.js +11 -53
  14. package/package.json +9 -4
  15. package/lib/cjs/common.d.ts +0 -16
  16. package/lib/cjs/common.d.ts.map +0 -1
  17. package/lib/cjs/common.js +0 -70
  18. package/lib/cjs/index.d.ts +0 -10
  19. package/lib/cjs/index.d.ts.map +0 -1
  20. package/lib/cjs/index.js +0 -22
  21. package/lib/cjs/mat2.d.ts +0 -272
  22. package/lib/cjs/mat2.d.ts.map +0 -1
  23. package/lib/cjs/mat2.js +0 -473
  24. package/lib/cjs/mat2d.d.ts +0 -329
  25. package/lib/cjs/mat2d.d.ts.map +0 -1
  26. package/lib/cjs/mat2d.js +0 -641
  27. package/lib/cjs/mat3.d.ts +0 -295
  28. package/lib/cjs/mat3.d.ts.map +0 -1
  29. package/lib/cjs/mat3.js +0 -670
  30. package/lib/cjs/mat4.d.ts +0 -532
  31. package/lib/cjs/mat4.d.ts.map +0 -1
  32. package/lib/cjs/mat4.js +0 -1576
  33. package/lib/cjs/quat.d.ts +0 -334
  34. package/lib/cjs/quat.d.ts.map +0 -1
  35. package/lib/cjs/quat.js +0 -802
  36. package/lib/cjs/scalar.d.ts +0 -501
  37. package/lib/cjs/scalar.d.ts.map +0 -1
  38. package/lib/cjs/scalar.js +0 -728
  39. package/lib/cjs/vec2.d.ts +0 -664
  40. package/lib/cjs/vec2.d.ts.map +0 -1
  41. package/lib/cjs/vec2.js +0 -1247
  42. package/lib/cjs/vec3.d.ts +0 -660
  43. package/lib/cjs/vec3.d.ts.map +0 -1
  44. package/lib/cjs/vec3.js +0 -1329
  45. package/lib/cjs/vec4.d.ts +0 -552
  46. package/lib/cjs/vec4.d.ts.map +0 -1
  47. package/lib/cjs/vec4.js +0 -1200
package/lib/cjs/mat3.d.ts DELETED
@@ -1,295 +0,0 @@
1
- import { mat2d } from './mat2d';
2
- import { mat4 } from './mat4';
3
- import { quat } from './quat';
4
- import { vec2 } from './vec2';
5
- import { vec3 } from './vec3';
6
- /**
7
- * Represents 2D affine transformation (translation, rotation, scaling, and skewing).
8
- * The format is column-major as in WebGL, so the matrix looks like this:
9
- * ```ts
10
- * [xx, xy, 0
11
- * yx, yy, 0
12
- * tx, ty, 1]
13
- * ```
14
- * @category Types
15
- */
16
- export type mat3 = readonly [
17
- m00: number,
18
- m01: number,
19
- m02: number,
20
- m10: number,
21
- m11: number,
22
- m12: number,
23
- m20: number,
24
- m21: number,
25
- m22: number
26
- ];
27
- /**
28
- * Functions for {@link mat3}, 2D affine transformation.
29
- * @category Modules
30
- */
31
- export declare namespace mat3 {
32
- /**
33
- * Mutable version of {@link mat3}
34
- * @category Types
35
- */
36
- type Mutable = [
37
- m00: number,
38
- m01: number,
39
- m02: number,
40
- m10: number,
41
- m11: number,
42
- m12: number,
43
- m20: number,
44
- m21: number,
45
- m22: number
46
- ];
47
- /**
48
- * Creates a new matrix from given elements
49
- * @category Generators
50
- */
51
- function of(m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): mat3;
52
- /**
53
- * Creates a mutable clone of given mat3
54
- * @category Generators
55
- */
56
- function clone(a: mat3): Mutable;
57
- /**
58
- * Copies the upper-left 3x3 values into the given mat3.
59
- * @category Generators
60
- */
61
- function fromMat4(a: mat4): mat3;
62
- /**
63
- * The identity matrix of mat3
64
- * ```ts
65
- * [1, 0, 0,
66
- * 0, 1, 0,
67
- * 0, 0, 1]
68
- * ```
69
- * @category Constants
70
- *
71
- * @shorthands
72
- * - {@link id}
73
- * - {@link ident}
74
- */
75
- const identity: mat3;
76
- /**
77
- * Alias for {@link identity}
78
- * @category Shorthands
79
- */
80
- const I: mat3;
81
- /**
82
- * Alias for {@link identity}
83
- * @category Shorthands
84
- */
85
- const id: mat3;
86
- /**
87
- * Alias for {@link identity}
88
- * @category Shorthands
89
- */
90
- const ident: mat3;
91
- /**
92
- * @category Constants
93
- */
94
- const zero: mat3;
95
- /**
96
- * Transpose the values of a mat3
97
- */
98
- function transpose(a: mat3): mat3;
99
- /**
100
- * Inverts a mat3
101
- *
102
- * @shorthands
103
- * - {@link inv}
104
- */
105
- function invert(a: mat3): mat3 | null;
106
- /**
107
- * Alias for {@link invert}
108
- * @category Shorthands
109
- */
110
- const inv: typeof invert;
111
- /**
112
- * Calculates the adjugate of a mat3
113
- */
114
- function adjoint(a: mat3): mat3;
115
- /**
116
- * Calculates the determinant of a mat3
117
- *
118
- * @shorthands
119
- * - {@link det}
120
- */
121
- function determinant(a: mat3): number;
122
- /**
123
- * Alias for {@link determinant}
124
- * @category Shorthands
125
- */
126
- const det: typeof determinant;
127
- /**
128
- * Multiplies given mat3's
129
- *
130
- * @shorthands
131
- * - {@link mul}
132
- */
133
- function multiply(...ms: mat3[]): mat3;
134
- /**
135
- * Alias for {@link multiply}
136
- * @category Shorthands
137
- */
138
- const mul: typeof multiply;
139
- /**
140
- * Translate a mat3 by the given vector
141
- */
142
- function translate(a: mat3, v: vec3): mat3;
143
- /**
144
- * Rotates a mat3 by the given angle
145
- */
146
- function rotate(a: mat3, deg: number): mat3;
147
- /**
148
- * Scales the mat3 by the dimensions in the given vec2
149
- **/
150
- function scale(a: mat3, v: vec2): mat3;
151
- /**
152
- * Creates a matrix from a vector translation
153
- * @category Generators
154
- *
155
- * @shorthands
156
- * - {@link translation}
157
- */
158
- function fromTranslation(v: vec2): mat3;
159
- /**
160
- * Alias for {@link fromTranslation}
161
- * @category Shorthands
162
- */
163
- const translation: typeof fromTranslation;
164
- /**
165
- * Creates a matrix from a given angle
166
- * @param deg The angle to rotate the matrix by, in degrees
167
- * @category Generators
168
- *
169
- * @shorthands
170
- * - {@link rotation}
171
- */
172
- function fromRotation(deg: number): mat3;
173
- /**
174
- * Alias for {@link fromRotation}
175
- * @category Shorthands
176
- */
177
- const rotation: typeof fromRotation;
178
- /**
179
- * Creates a matrix from a vector scaling
180
- * @category Generators
181
- *
182
- * @shorthands
183
- * - {@link scaling}
184
- */
185
- function fromScaling(v: vec2): mat3;
186
- /**
187
- * Alias for {@link fromScaling}
188
- * @category Shorthands
189
- */
190
- const scaling: typeof fromScaling;
191
- /**
192
- * Copies the values from a {@link mat2d}
193
- * @category Generators
194
- **/
195
- function fromMat2d(a: mat2d): mat3;
196
- /**
197
- * Calculates a 3x3 matrix from the given quaternion
198
- * @category Generators
199
- *
200
- */
201
- function fromQuat(q: quat): mat3;
202
- /**
203
- * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
204
- *
205
- */
206
- function normalFromMat4(a: mat4): mat3 | null;
207
- /**
208
- * Generates a 2D projection matrix with the given bounds
209
- * @category Generators
210
- */
211
- function projection(width: number, height: number): mat3;
212
- /**
213
- * Returns Frobenius norm of a mat3
214
- */
215
- function frob(a: mat3): number;
216
- /**
217
- * Adds given mat3's
218
- */
219
- function add(...ms: mat3[]): mat3;
220
- /**
221
- * Subtracts matrix b from matrix a
222
- *
223
- * @shorthands
224
- * - {@link sub}
225
- */
226
- function subtract(...ms: mat3[]): mat3;
227
- /**
228
- * Alias for {@link subtract}
229
- * @category Shorthands
230
- */
231
- const sub: typeof subtract;
232
- /**
233
- * Subtracts b from a
234
- */
235
- function delta(a: mat3, b: mat3): mat3;
236
- /**
237
- * Multiply each element of the matrix by a scalar.
238
- */
239
- function multiplyScalar(a: mat3, s: number): mat3;
240
- /**
241
- Adds given mat3's after multiplying each element of the second operand by a scalar value.
242
- */
243
- function multiplyScalarAndAdd(a: mat3, b: mat3, scale: number): mat3;
244
- /**
245
- * Constrain each element to lie between min and max
246
- * @see https://thebookofshaders.com/glossary/?search=clamp
247
- */
248
- function clamp(a: mat3, min: number, max: number): mat3;
249
- /**
250
- * Clamps each element to [0, 1]
251
- */
252
- function clamp01(a: mat3): mat3;
253
- /**
254
- * Clamps each element to [-1, 1]
255
- */
256
- function clamp11(a: mat3): mat3;
257
- /**
258
- * Returns whether or not the matrices have exactly the same elements in the same position (when compared with `===`)
259
- *
260
- * @shorthands
261
- * - {@link eq}
262
- */
263
- function exactEquals(a: mat3, b: mat3): boolean;
264
- /**
265
- * Alias for {@link exactEquals}
266
- * @category Shorthands
267
- */
268
- const eq: typeof exactEquals;
269
- /**
270
- * Returns whether or not the matrices have approximately the same elements in the same position.
271
- *
272
- * @shorthands
273
- * - {@link approx}
274
- * - {@link equals}
275
- */
276
- function approxEquals(a: mat3, b: mat3): boolean;
277
- /**
278
- * Alias for {@link approxEquals}
279
- * @category Shorthands
280
- */
281
- const approx: typeof approxEquals;
282
- /**
283
- * Alias for {@link approxEquals}. This is provided for compatibility with gl-matrix.
284
- * @category Shorthands
285
- * @deprecated Use {@link approxEquals} instead
286
- */
287
- const equals: typeof approxEquals;
288
- /**
289
- * Returns a string representation of a mat3
290
- * @param m matrix to represent as a string
291
- * @param fractionDigits number of digits to appear after the decimal point
292
- */
293
- const toString: (m: mat3, fractionDigits?: number) => string;
294
- }
295
- //# sourceMappingURL=mat3.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mat3.d.ts","sourceRoot":"","sources":["../../src/mat3.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC3B,OAAO,E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