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/vec2.d.ts DELETED
@@ -1,664 +0,0 @@
1
- import { mat2 } from './mat2';
2
- import { mat2d } from './mat2d';
3
- import { mat3 } from './mat3';
4
- import { vec3 } from './vec3';
5
- /**
6
- * Represents 2D vector
7
- * @category Types
8
- */
9
- export type vec2 = readonly [x: number, y: number];
10
- /**
11
- * Functions for {@link vec2}, a 2D vector.
12
- * @category Modules
13
- */
14
- export declare namespace vec2 {
15
- /**
16
- * Mutable version of {@link vec2}
17
- * @category Types
18
- */
19
- type Mutable = [x: number, y: number];
20
- /**
21
- * Creates a new vector from given elements
22
- * @category Generators
23
- */
24
- function of(x: number, y?: number): vec2;
25
- /**
26
- * Creates a mutable clone of given vec2
27
- * @category Generators
28
- */
29
- function clone(a: vec2): Mutable;
30
- /**
31
- * @category Constants
32
- */
33
- const zero: vec2;
34
- /**
35
- * @category Constants
36
- */
37
- const one: vec2;
38
- /**
39
- * A unit vector pointing toward positive X. Same as `[1, 0]`
40
- * @category Constants
41
- */
42
- const unitX: vec2;
43
- /**
44
- * A unit vector pointing toward positive Y. Same as `[0, 1]`
45
- * @category Constants
46
- */
47
- const unitY: vec2;
48
- /**
49
- * Adds the given vectors
50
- */
51
- function add(...vs: (vec2 | number)[]): vec2;
52
- /**
53
- * Subtracts the given vec2's. When the argument is a single vector, it negates it. Otherwise, it subtracts from left to right.
54
- *
55
- * @shorthands
56
- * - {@link sub}
57
- */
58
- function subtract(...vs: (vec2 | number)[]): vec2;
59
- /**
60
- * Alias for {@link vec2.subtract}
61
- * @category Shorthands
62
- */
63
- const sub: typeof subtract;
64
- /**
65
- * Subtracts `a` from `b` component-wise
66
- */
67
- function delta(a: vec2 | number, b: vec2 | number): vec2;
68
- /**
69
- * Multiplies the given vec2's component-wise
70
- *
71
- * @shorthands
72
- * - {@link mul}
73
- */
74
- function multiply(...vs: (vec2 | number)[]): vec2;
75
- /**
76
- * Alias for {@link vec2.multiply}
77
- * @category Shorthands
78
- */
79
- const mul: typeof multiply;
80
- /**
81
- * Divides the given vec2's component-wise
82
- *
83
- * @shorthands
84
- * - {@link div}
85
- */
86
- function divide(...vs: (vec2 | number)[]): vec2;
87
- /**
88
- * Alias for {@link vec2.divide}
89
- * @category Shorthands
90
- */
91
- const div: typeof divide;
92
- /**
93
- * Returns the component-wise minimum of the given vec2's
94
- */
95
- function min(...vs: (vec2 | number)[]): vec2;
96
- /**
97
- * Returns the component-wise maximum of the given vec2's
98
- */
99
- function max(...vs: (vec2 | number)[]): vec2;
100
- /**
101
- * Constrain a value to lie between two further values
102
- * @see https://thebookofshaders.com/glossary/?search=clamp
103
- * @param v the value to constrain
104
- * @param min the lower end of the range into which to constrain `v`
105
- * @param max the upper end of the range into which to constrain `v`
106
- */
107
- function clamp(v: vec2, min: vec2 | number, max: vec2 | number): vec2;
108
- /**
109
- * Clamps each component to [0, 1]. Equivalent to {@link saturate}.
110
- */
111
- function clamp01(v: vec2): vec2;
112
- /**
113
- * Clamps each component to [-1, 1]
114
- */
115
- function clamp11(v: vec2): vec2;
116
- /**
117
- * Returns the absolute value of each component of a vec2
118
- */
119
- function abs(v: vec2): vec2;
120
- /**
121
- * Symmetric round the components of a vec2
122
- */
123
- function round(a: vec2): vec2;
124
- /**
125
- * Applies Math.ceil to each component of a vec2
126
- */
127
- function ceil(a: vec2): vec2;
128
- /**
129
- * Applies Math.floor to each component of a vec2
130
- */
131
- function floor(a: vec2): vec2;
132
- /**
133
- * Applies Math.sign to each component of a vec2
134
- */
135
- function sign(v: vec2): vec2;
136
- /**
137
- * Removes the fractional part
138
- * @see https://www.sidefx.com/docs/houdini/vex/functions/trunc.html
139
- */
140
- function trunc(v: vec2): vec2;
141
- /**
142
- * Computes the fractional part of the argument
143
- * @see https://registry.khronos.org/OpenGL-Refpages/gl4/html/fract.xhtml
144
- */
145
- function fract(a: vec2): vec2;
146
- /**
147
- * Computes the value of one parameter modulo another. This is computed as x - y * floor(x/y). Unlike JavaScript's `%` operator, the sign of result always matches to `b`.
148
- * @see https://thebookofshaders.com/glossary/?search=mod
149
- */
150
- function mod(a: vec2, b: vec2 | number): vec2;
151
- /**
152
- * Quantize a vec2 to a given step and offset. If the step is 0, the value is returned unchanged.
153
- * @param v The value to quantize
154
- * @param step The step size
155
- * @param offset The offset
156
- * @returns The quantized value
157
- */
158
- function quantize(v: vec2, step: vec2 | number, offset?: vec2 | number): vec2;
159
- /**
160
- * Scales a vec2 by a scalar number
161
- *
162
- * @param a the vector to scale
163
- * @param s amount to scale the vector by
164
- */
165
- function scale(a: vec2, s: number): vec2;
166
- /**
167
- * Returns the average value of the input(s)
168
- * @see https://www.sidefx.com/docs/houdini/vex/functions/avg.html
169
- *
170
- * @shorthands
171
- * - {@link avg}
172
- */
173
- function average(...vs: vec2[]): vec2;
174
- /**
175
- * Alias for {@link vec2.average}
176
- * @category Shorthands
177
- */
178
- const avg: typeof average;
179
- /**
180
- Adds given vec2's after scaling the second operand by a scalar value
181
- */
182
- function scaleAndAdd(a: vec2, b: vec2, scale: number): vec2;
183
- /**
184
- * Calculates the euclidian distance between two vec2's
185
- *
186
- * @shorthands
187
- * - {@link dist}
188
- */
189
- function distance(a: vec2, b: vec2): number;
190
- /**
191
- * Alias for {@link vec2.distance}
192
- * @category Shorthands
193
- */
194
- const dist: typeof distance;
195
- /**
196
- * Calculates the squared euclidian distance between two vec2's
197
- *
198
- * @shorthands
199
- * - {@link sqrDist}
200
- */
201
- function squaredDistance(a: vec2, b: vec2): number;
202
- /**
203
- * Alias for {@link vec2.squaredDistance}
204
- * @category Shorthands
205
- */
206
- const sqrDist: typeof squaredDistance;
207
- /**
208
- * Returns the absolute difference between corresponding components of two vec2's
209
- *
210
- * @shorthands
211
- * - {@link diff}
212
- */
213
- function difference(a: vec2, b: vec2): vec2;
214
- /**
215
- * Alias for {@link vec2.difference}
216
- * @category Shorthands
217
- */
218
- const diff: typeof difference;
219
- /**
220
- * Calculates the length of a vec2
221
- *
222
- * @shorthands
223
- * - {@link len}
224
- */
225
- function length(v: vec2): number;
226
- /**
227
- * Alias for {@link vec2.length}
228
- * @category Shorthands
229
- */
230
- const len: typeof length;
231
- /**
232
- * Calculates the squared length of a vec2
233
- *
234
- * @shorthands
235
- * - {@link sqrLen}
236
- */
237
- function squaredLength(v: vec2): number;
238
- /**
239
- * Alias for {@link vec2.squaredLength}
240
- * @category Shorthands
241
- */
242
- const sqrLen: typeof squaredLength;
243
- /**
244
- * Negates the components of a vec2
245
- *
246
- * @shorthands
247
- * - {@link neg}
248
- */
249
- function negate(v: vec2): vec2;
250
- /**
251
- * Alias for {@link vec2.negate}
252
- * @category Shorthands
253
- */
254
- const neg: typeof negate;
255
- /**
256
- * Returns the inverse of the components of a vec2
257
- *
258
- * @shorthands
259
- * - {@link inv}
260
- */
261
- function invert(v: vec2): vec2;
262
- /**
263
- * Alias for {@link vec2.invert}
264
- * @category Shorthands
265
- */
266
- const inv: typeof invert;
267
- /**
268
- * Returns the result of `v` subtracted from {@link vec2.one}.
269
- */
270
- function oneMinus(v: vec2): vec2;
271
- /**
272
- * Normalizes a vec2 to unit length. Returns the zero vector if the input has zero length.
273
- */
274
- function normalize(v: vec2): vec2;
275
- /**
276
- * Calculates the dot product of two vec2's
277
- */
278
- function dot(a: vec2, b: vec2): number;
279
- /**
280
- * Computes the cross product of two vec2's. Returns a vec3 with x and y components set to 0.
281
- */
282
- function cross(a: vec2, b: vec2): vec3;
283
- /**
284
- * Reflects incident vector `I` about normal `N`. The normal `N` should be normalized.
285
- * @see https://registry.khronos.org/OpenGL-Refpages/gl4/html/reflect.xhtml
286
- * @param I Incident vector
287
- * @param N Normal vector (should be normalized)
288
- */
289
- function reflect(I: vec2, N: vec2): vec2;
290
- /**
291
- * Computes the refraction vector for incident vector `I`, surface normal `N`, and ratio of indices of refraction `eta`. The normal `N` should be normalized.
292
- * @see https://registry.khronos.org/OpenGL-Refpages/gl4/html/refract.xhtml
293
- * @param I Incident vector
294
- * @param N Normal vector (should be normalized)
295
- * @param eta Ratio of indices of refraction
296
- * @returns The refraction vector, or zero vector for total internal reflection
297
- */
298
- function refract(I: vec2, N: vec2, eta: number): vec2;
299
- /**
300
- * Orients a normal to point away from a surface as defined by its incident vector. Returns `N` if `dot(Nref, I) < 0`, otherwise returns `-N`.
301
- * @see https://registry.khronos.org/OpenGL-Refpages/gl4/html/faceforward.xhtml
302
- * @param N Normal vector
303
- * @param I Incident vector
304
- * @param Nref Reference normal
305
- */
306
- function faceforward(N: vec2, I: vec2, Nref: vec2): vec2;
307
- /**
308
- * Projects vector `a` onto vector `b`.
309
- * @param a The vector to project
310
- * @param b The vector to project onto
311
- */
312
- function project(a: vec2, b: vec2): vec2;
313
- /**
314
- * Computes the rejection of vector `a` from vector `b` (the component of `a` perpendicular to `b`).
315
- * @param a The vector to reject
316
- * @param b The vector to reject from
317
- */
318
- function reject(a: vec2, b: vec2): vec2;
319
- /**
320
- * Linearly interpolates between two vec2's. Same as GLSL's built-in `mix` function.
321
- * @see https://registry.khronos.org/OpenGL-Refpages/gl4/html/mix.xhtml
322
- *
323
- * @shorthands
324
- * - {@link mix}
325
- */
326
- function lerp(a: vec2, b: vec2, t: vec2 | number): vec2;
327
- /**
328
- * Alias for {@link vec2.lerp}
329
- * @see https://registry.khronos.org/OpenGL-Refpages/gl4/html/mix.xhtml
330
- * @category Shorthands
331
- */
332
- const mix: typeof lerp;
333
- /**
334
- * Returns the amount to mix `min` and `max` to generate the input value `t`. This is the inverse of the `lerp` function. If `min` and `max` are equal, the mixing value is `0.5`.
335
- * @see https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Inverse-Lerp-Node.html
336
- * @see https://www.sidefx.com/docs/houdini/vex/functions/invlerp.html
337
- *
338
- * @shorthands
339
- * - {@link invlerp}
340
- */
341
- function inverseLerp(a: vec2, b: vec2, t: vec2): vec2;
342
- /**
343
- * Alias for {@link vec2.inverseLerp}
344
- * @category Shorthands
345
- */
346
- const invlerp: typeof inverseLerp;
347
- /**
348
- * Performs a spherical linear interpolation between two vec2's
349
- */
350
- function slerp(a: vec2, b: vec2, t: number): vec2;
351
- /**
352
- * Performs a hermite interpolation with two control points
353
- *
354
- * @param a the first operand
355
- * @param b the second operand
356
- * @param c the third operand
357
- * @param d the fourth operand
358
- * @param t interpolation amount, in the range [0-1], between the two inputs
359
- */
360
- function hermite(a: vec2, b: vec2, c: vec2, d: vec2, t: number): vec2;
361
- /**
362
- * Performs a bezier interpolation with two control points
363
- */
364
- function bezier(a: vec2, b: vec2, c: vec2, d: vec2, t: number): vec2;
365
- /**
366
- * Takes the value in the range `(omin, omax)` and shifts it to the corresponding value in the new range `(nmin, nmax)`. The function clamps the given value the range `(omin, omax)` before fitting, so the resulting value will be guaranteed to be in the range `(nmin, nmax)`. To avoid clamping use efit instead.
367
- * @see https://www.sidefx.com/docs/houdini/vex/functions/fit.html
368
- * @param value
369
- * @param omin
370
- * @param omax
371
- * @param nmin
372
- * @param nmax
373
- * @returns
374
- */
375
- function fit(value: vec2, omin: vec2, omax: vec2, nmin: vec2, nmax: vec2): vec2;
376
- /**
377
- * Takes the value in the range `(omin, omax)` and shifts it to the corresponding value in the new range `(nmin, nmax)`. Unlike `fit`, this function does not clamp values to the given range. If `omin` and `omax` are the same, the function returns the average of `nmin` and `nmax`.
378
- * @see https://www.sidefx.com/docs/houdini/vex/functions/fit.html
379
- * @param value
380
- * @param omin
381
- * @param omax
382
- * @param nmin
383
- * @param nmax
384
- * @returns
385
- */
386
- function efit(value: vec2, omin: vec2, omax: vec2, nmin: vec2, nmax: vec2): vec2;
387
- /**
388
- * Takes the value in the range `(0, 1)` and shifts it to the corresponding value in the new range `(nmin, nmax)`.
389
- * @see https://www.sidefx.com/docs/houdini/vex/functions/fit01.html
390
- */
391
- function fit01(value: vec2, nmin: vec2, nmax: vec2): vec2;
392
- /**
393
- * Takes the value in the range `(-1, 1)` and shifts it to the corresponding value in the new range `(nmin, nmax)`.
394
- * @see https://www.sidefx.com/docs/houdini/vex/functions/fit11.html
395
- */
396
- function fit11(value: vec2, nmin: vec2, nmax: vec2): vec2;
397
- /**
398
- * Transforms the vec2 with a mat2
399
- */
400
- function transformMat2(a: vec2, m: mat2): vec2;
401
- /**
402
- * Transforms the vec2 with a mat2d
403
- * 3rd vector component is implicitly '1'
404
- */
405
- function transformMat2d(a: vec2, m: mat2d): vec2;
406
- /**
407
- * Transforms the vec2 with a mat3
408
- * 3rd vector component is implicitly '1'
409
- */
410
- function transformMat3(a: vec2, m: mat3): vec2;
411
- /**
412
- * Transforms a vec2 with a matrix, automatically choosing the appropriate transformation function based on matrix size
413
- * @param p The vector to transform
414
- * @param m The transformation matrix (mat2, mat2d, or mat3)
415
- * @returns The transformed vector
416
- *
417
- * @shorthands
418
- * - {@link xform}
419
- */
420
- function transform(p: vec2, m: mat2 | mat2d | mat3): vec2;
421
- /**
422
- * Alias for {@link vec2.transform}
423
- * @category Shorthands
424
- */
425
- const xform: typeof transform;
426
- /**
427
- * Rotate a 2D vector
428
- */
429
- function rotate(a: vec2, deg: number, origin?: vec2): vec2;
430
- /**
431
- * Rotates a vector by 90 degrees
432
- * @param a the vector to rotate
433
- * @param sweep If true, the rotation is in positive direction. For example, it means clockwise rotation in a Y-down coordinate system.
434
- * @param origin The origin of the rotation
435
- * @returns The rotated vector
436
-
437
- */
438
- function rotate90(a: vec2, sweep?: boolean, origin?: vec2): vec2;
439
- /**
440
- * Get the angle between two 2D vectors. If the second argument is omitted, it returns a signed angle relative to x axis.
441
- * @param a The first vector
442
- * @param b The second vector
443
- * @returns The angle in degrees. If the angle from a to b is clockwise, the return value is positive. Otherwise, it is negative. The range is (-180, 180].
444
- */
445
- function angle(a: vec2, b?: vec2): number;
446
- /**
447
- * Creates a vector by given direction, length, and origin
448
- * @param deg The direction in degrees
449
- * @param length The length of the vector to create. Default is 1
450
- * @param origin The origin of the vector. Default is [0, 0]
451
- *
452
- * @shorthands
453
- * - {@link dir}
454
- */
455
- function direction(deg: number, length?: number, origin?: vec2): vec2;
456
- /**
457
- * Alias for {@link vec2.direction}
458
- * @category Shorthands
459
- */
460
- const dir: typeof direction;
461
- /**
462
- * Apply a step function by comparing two values
463
- * @see https://registry.khronos.org/OpenGL-Refpages/gl4/html/step.xhtml
464
- * @param edge The location of the edge of the step function.
465
- * @param v The value to be used to generate the step function.
466
- * @returns
467
- */
468
- function step(edge: vec2 | number, v: vec2 | number): vec2;
469
- /**
470
- * Perform Hermite interpolation between two values.
471
- * @see https://registry.khronos.org/OpenGL-Refpages/gl4/html/smoothstep.xhtml
472
- * @param edge0 Lower edge of the Hermite function.
473
- * @param edge1 Upper edge of the Hermite function.
474
- * @param x Source value for interpolation.
475
- * @returns
476
- */
477
- function smoothstep(edge0: vec2 | number, edge1: vec2 | number, x: vec2): number[];
478
- /**
479
- * Converts the components of a vec2 from radians to degrees
480
- * @param rad The input vec2 in radians
481
- * @returns The degrees equivalent of the input
482
- *
483
- * @shorthands
484
- * - {@link deg}
485
- */
486
- function degrees(rad: vec2): vec2;
487
- /**
488
- * Alias for {@link vec2.degrees}
489
- * @category Shorthands
490
- */
491
- const deg: typeof degrees;
492
- /**
493
- * Converts the components of a vec2 from degrees to radians
494
- * @param deg The input vec2 in degrees
495
- * @returns The radians equivalent of the input
496
- *
497
- * @shorthands
498
- * - {@link rad}
499
- */
500
- function radians(deg: vec2): vec2;
501
- /**
502
- * Alias for {@link vec2.radians}
503
- * @category Shorthands
504
- */
505
- const rad: typeof radians;
506
- /**
507
- * Returns the sine of a number.
508
- * @param deg An angle in degrees
509
- */
510
- function sin(deg: vec2): vec2;
511
- /**
512
- * Returns the cosine of a number.
513
- * @param deg An angle in degrees
514
- */
515
- function cos(deg: vec2): vec2;
516
- /**
517
- * Returns the tangent of a number.
518
- * @param deg An angle in degrees
519
- */
520
- function tan(deg: vec2): vec2;
521
- /**
522
- * Returns the arcsine of a number.
523
- * @param v A numeric expression.
524
- * @returns The arcsine in degrees
525
- * */
526
- function asin(v: vec2): vec2;
527
- /**
528
- * Returns the arc cosine (or inverse cosine) of a number.
529
- * @param v A numeric expression.
530
- * @returns The arc cosine in degrees
531
- * */
532
- function acos(v: vec2): vec2;
533
- /**
534
- * Returns the arc-tangent of the parameters. If `x` is not provided, `y` is regarded as a value of `y/x`.
535
- * @param y the values of the y-coordinate
536
- * @param x the values of the x-coordinate
537
- * @returns the angle in degrees
538
- * @see https://thebookofshaders.com/glossary/?search=atan
539
- * */
540
- function atan(y: vec2, x?: vec2): vec2;
541
- /**
542
- * Returns the arc-tangent of the parameters.
543
- * @param y the values of the y-coordinate
544
- * @param x the values of the x-coordinate
545
- * @returns the angle in degrees
546
- * @see https://thebookofshaders.com/glossary/?search=atan
547
- * */
548
- function atan2(y: vec2, x: vec2): vec2;
549
- /**
550
- * Returns the base to the exponent power, component-wise
551
- */
552
- function pow(a: vec2, b: vec2 | number): vec2;
553
- /**
554
- * Returns e raised to the power of each component
555
- */
556
- function exp(v: vec2): vec2;
557
- /**
558
- * Returns the natural logarithm of each component
559
- */
560
- function log(v: vec2): vec2;
561
- /**
562
- * Returns 2 raised to the power of the parameter
563
- * @param v the value of the power to which 2 will be raised
564
- */
565
- function exp2(v: vec2): vec2;
566
- /**
567
- * Returns the base-2 logarithm of each component
568
- */
569
- function log2(v: vec2): vec2;
570
- /**
571
- * Returns the square root of each component
572
- */
573
- function sqrt(v: vec2): vec2;
574
- /**
575
- * Returns the inverse of the square root of the parameter
576
- * @param v the value of which to take the inverse of the square root
577
- * @see https://thebookofshaders.com/glossary/?search=inversesqrt
578
- *
579
- * @shorthands
580
- * - {@link invsqrt}
581
- */
582
- function inverseSqrt(v: vec2): vec2;
583
- /**
584
- * Alias for {@link vec2.inverseSqrt}
585
- * @category Shorthands
586
- */
587
- const invsqrt: typeof inverseSqrt;
588
- /**
589
- * Returns the hyperbolic sine of each component
590
- */
591
- function sinh(v: vec2): vec2;
592
- /**
593
- * Returns the hyperbolic cosine of each component
594
- */
595
- function cosh(v: vec2): vec2;
596
- /**
597
- * Returns the hyperbolic tangent of each component
598
- */
599
- function tanh(v: vec2): vec2;
600
- /**
601
- * Returns the inverse hyperbolic sine of each component
602
- */
603
- function asinh(v: vec2): vec2;
604
- /**
605
- * Returns the inverse hyperbolic cosine of each component
606
- */
607
- function acosh(v: vec2): vec2;
608
- /**
609
- * Returns the inverse hyperbolic tangent of each component
610
- */
611
- function atanh(v: vec2): vec2;
612
- /**
613
- * Clamps each component to [0, 1]. Equivalent to HLSL's `saturate`.
614
- */
615
- function saturate(v: vec2): vec2;
616
- /**
617
- * Returns the sum of all components of a vector.
618
- * Equivalent to GLM's `glm::compAdd`.
619
- */
620
- function compAdd(v: vec2): number;
621
- /**
622
- * Returns the product of all components of a vector.
623
- * Equivalent to GLM's `glm::compMul`.
624
- */
625
- function compMul(v: vec2): number;
626
- /**
627
- * Returns whether or not the vectors exactly have the same elements in the same position (when compared with `===`)
628
- *
629
- * @shorthands
630
- * - {@link eq}
631
- */
632
- function exactEquals(a: vec2, b: vec2): boolean;
633
- /**
634
- * Alias for {@link exactEquals}
635
- * @category Shorthands
636
- */
637
- const eq: typeof exactEquals;
638
- /**
639
- * Returns whether or not the vectors have approximately the same elements in the same position.
640
- *
641
- * @shorthands
642
- * - {@link approx}
643
- * - {@link equals}
644
- */
645
- function approxEquals(a: vec2, b: vec2): boolean;
646
- /**
647
- * Alias for {@link approxEquals}
648
- * @category Shorthands
649
- */
650
- const approx: typeof approxEquals;
651
- /**
652
- * Alias for {@link approxEquals}. This is provided for compatibility with gl-matrix.
653
- * @category Shorthands
654
- * @deprecated Use {@link approxEquals} instead
655
- */
656
- const equals: typeof approxEquals;
657
- /**
658
- * Returns the string representation of a vec2
659
- * @param v vector to represent as a string
660
- * @param fractionDigits number of digits to appear after the decimal point
661
- */
662
- const toString: (v: vec2, fractionDigits?: number) => string;
663
- }
664
- //# sourceMappingURL=vec2.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vec2.d.ts","sourceRoot":"","sources":["../../src/vec2.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAE3B;;;GAGG;AACH,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;AAElD;;;GAGG;AACH,yBAAiB,IAAI,CAAC;IACrB;;;OAGG;IACH,KAAY,OAAO,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;IAE5C;;;OAGG;IACH,SAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAE,MAAU,GAAG,IAAI,CAEjD;IAED;;;OAGG;IACH,SAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAEtC;IAED;;OAEG;IACI,MAAM,IAAI,EAAE,IAA4B,CAAA;IAE/C;;OAEG;IACI,MAAM,GAAG,EAAE,IAA4B,CAAA;IAE9C;;;OAGG;IACI,MAAM,KAAK,EAAE,IAA4B,CAAA;IAEhD;;;OAGG;IACI,MAAM,KAAK,EAAE,IAA4B,CAAA;IAEhD;;OAEG;IACH,SAAgB,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,CAAC,EAAE,GAAG,IAAI,CAelD;IAED;;;;;OAKG;IACH,SAAgB,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,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