curvy 1.0.9 → 2.0.0-alpha.2
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.
- package/dist/characteristic/index.d.mts +88 -0
- package/dist/characteristic/index.mjs +2 -0
- package/dist/curve/index.d.mts +2 -0
- package/dist/curve/index.mjs +2 -0
- package/dist/interval/index.d.mts +3 -0
- package/dist/interval/index.mjs +3 -0
- package/dist/matrix/index.d.mts +2 -0
- package/dist/matrix/index.mjs +267 -0
- package/dist/matrix/index.mjs.map +1 -0
- package/dist/number.d.mts +280 -0
- package/dist/number.mjs +140 -0
- package/dist/number.mjs.map +1 -0
- package/dist/path/index.d.mts +261 -0
- package/dist/path/index.mjs +325 -0
- package/dist/path/index.mjs.map +1 -0
- package/dist/polynomial/index.d.mts +2 -0
- package/dist/polynomial/index.mjs +3 -0
- package/dist/shared/characteristic-B9nCh_cx.mjs +104 -0
- package/dist/shared/characteristic-B9nCh_cx.mjs.map +1 -0
- package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
- package/dist/shared/cubic-BajUY0JT.d.mts +1100 -0
- package/dist/shared/cubic-CpHAx8cC.mjs +479 -0
- package/dist/shared/cubic-CpHAx8cC.mjs.map +1 -0
- package/dist/shared/interval-05CR6eBf.mjs +421 -0
- package/dist/shared/interval-05CR6eBf.mjs.map +1 -0
- package/dist/shared/interval-Dy-RMEE3.d.mts +533 -0
- package/dist/shared/interval2d-8IBZnUOq.mjs +108 -0
- package/dist/shared/interval2d-8IBZnUOq.mjs.map +1 -0
- package/dist/shared/interval2d-C2id9u31.d.mts +172 -0
- package/dist/shared/matrix4x4-Ck2WROK-.mjs +440 -0
- package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +1 -0
- package/dist/shared/matrix4x4-Dm_tSiH1.d.mts +1183 -0
- package/dist/shared/quadratic-CamozcFc.mjs +330 -0
- package/dist/shared/quadratic-CamozcFc.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-B6g97ryJ.d.mts +308 -0
- package/dist/shared/rationalCubic2d-BEgUGSFf.mjs +295 -0
- package/dist/shared/rationalCubic2d-BEgUGSFf.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-Bys2Uory.mjs +695 -0
- package/dist/shared/rationalCubic2d-Bys2Uory.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-DlQfBURs.d.mts +818 -0
- package/dist/shared/solution-CrtLfqEq.mjs +306 -0
- package/dist/shared/solution-CrtLfqEq.mjs.map +1 -0
- package/dist/shared/solution-sNQ-ZVhN.d.mts +251 -0
- package/dist/{pipe.d.mts → shared/utils-MCckigYk.d.mts} +44 -26
- package/dist/shared/vector2-CL1HDdPr.mjs +187 -0
- package/dist/shared/vector2-CL1HDdPr.mjs.map +1 -0
- package/dist/shared/vector2-DPUY3_eA.d.mts +470 -0
- package/dist/shared/vector2.internal-DU_E808S.mjs +97 -0
- package/dist/shared/vector2.internal-DU_E808S.mjs.map +1 -0
- package/dist/shared/vector3-D-tv_aKL.mjs +204 -0
- package/dist/shared/vector3-D-tv_aKL.mjs.map +1 -0
- package/dist/shared/vector3-DqeOZtOB.d.mts +703 -0
- package/dist/shared/vector4-5KbjoHVj.mjs +109 -0
- package/dist/shared/vector4-5KbjoHVj.mjs.map +1 -0
- package/dist/shared/vector4.internal-5XcaX12X.mjs +163 -0
- package/dist/shared/vector4.internal-5XcaX12X.mjs.map +1 -0
- package/dist/solution/index.d.mts +2 -0
- package/dist/solution/index.mjs +2 -0
- package/dist/splines/index.d.mts +701 -0
- package/dist/splines/index.mjs +734 -0
- package/dist/splines/index.mjs.map +1 -0
- package/dist/utils.d.mts +2 -205
- package/dist/utils.mjs +88 -52
- package/dist/utils.mjs.map +1 -1
- package/dist/vector/index.d.mts +3 -0
- package/dist/vector/index.mjs +4 -0
- package/package.json +49 -92
- package/dist/curve/cubic2d.d.mts +0 -109
- package/dist/curve/cubic2d.d.ts +0 -109
- package/dist/curve/cubic2d.mjs +0 -80
- package/dist/curve/cubic2d.mjs.map +0 -1
- package/dist/curve/linear2d.d.mts +0 -94
- package/dist/curve/linear2d.d.ts +0 -94
- package/dist/curve/linear2d.mjs +0 -46
- package/dist/curve/linear2d.mjs.map +0 -1
- package/dist/curve/quadratic2d.d.mts +0 -117
- package/dist/curve/quadratic2d.d.ts +0 -117
- package/dist/curve/quadratic2d.mjs +0 -82
- package/dist/curve/quadratic2d.mjs.map +0 -1
- package/dist/interval.d.mts +0 -251
- package/dist/interval.d.ts +0 -251
- package/dist/interval.mjs +0 -86
- package/dist/interval.mjs.map +0 -1
- package/dist/matrix/matrix2x2.d.mts +0 -320
- package/dist/matrix/matrix2x2.d.ts +0 -320
- package/dist/matrix/matrix2x2.mjs +0 -25
- package/dist/matrix/matrix2x2.mjs.map +0 -1
- package/dist/matrix/matrix3x3.d.mts +0 -370
- package/dist/matrix/matrix3x3.d.ts +0 -370
- package/dist/matrix/matrix3x3.mjs +0 -28
- package/dist/matrix/matrix3x3.mjs.map +0 -1
- package/dist/matrix/matrix4x4.d.mts +0 -381
- package/dist/matrix/matrix4x4.d.ts +0 -381
- package/dist/matrix/matrix4x4.mjs +0 -178
- package/dist/matrix/matrix4x4.mjs.map +0 -1
- package/dist/path/cubic2d.d.mts +0 -95
- package/dist/path/cubic2d.d.ts +0 -95
- package/dist/path/cubic2d.mjs +0 -60
- package/dist/path/cubic2d.mjs.map +0 -1
- package/dist/path/linear2d.d.mts +0 -95
- package/dist/path/linear2d.d.ts +0 -95
- package/dist/path/linear2d.mjs +0 -53
- package/dist/path/linear2d.mjs.map +0 -1
- package/dist/path/quadratic2d.d.mts +0 -95
- package/dist/path/quadratic2d.d.ts +0 -95
- package/dist/path/quadratic2d.mjs +0 -57
- package/dist/path/quadratic2d.mjs.map +0 -1
- package/dist/pipe.d.ts +0 -58
- package/dist/pipe.mjs +0 -92
- package/dist/pipe.mjs.map +0 -1
- package/dist/polynomial/cubic.d.mts +0 -7
- package/dist/polynomial/cubic.d.ts +0 -7
- package/dist/polynomial/cubic.mjs +0 -133
- package/dist/polynomial/cubic.mjs.map +0 -1
- package/dist/polynomial/linear.d.mts +0 -7
- package/dist/polynomial/linear.d.ts +0 -7
- package/dist/polynomial/linear.mjs +0 -24
- package/dist/polynomial/linear.mjs.map +0 -1
- package/dist/polynomial/quadratic.d.mts +0 -7
- package/dist/polynomial/quadratic.d.ts +0 -7
- package/dist/polynomial/quadratic.mjs +0 -27
- package/dist/polynomial/quadratic.mjs.map +0 -1
- package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
- package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
- package/dist/shared/curvy.BkkW8Tx9.mjs +0 -102
- package/dist/shared/curvy.BkkW8Tx9.mjs.map +0 -1
- package/dist/shared/curvy.BxdGW9he.mjs +0 -116
- package/dist/shared/curvy.BxdGW9he.mjs.map +0 -1
- package/dist/shared/curvy.C_sCeg9J.mjs +0 -66
- package/dist/shared/curvy.C_sCeg9J.mjs.map +0 -1
- package/dist/shared/curvy.Cg8lZVUz.d.ts +0 -688
- package/dist/shared/curvy.DCt1gGII.mjs +0 -147
- package/dist/shared/curvy.DCt1gGII.mjs.map +0 -1
- package/dist/shared/curvy.DJ4xO0al.mjs +0 -63
- package/dist/shared/curvy.DJ4xO0al.mjs.map +0 -1
- package/dist/shared/curvy.DmVFTi0N.mjs +0 -35
- package/dist/shared/curvy.DmVFTi0N.mjs.map +0 -1
- package/dist/shared/curvy.FDaj5rlj.d.mts +0 -688
- package/dist/shared/curvy.lktriTpx.mjs +0 -101
- package/dist/shared/curvy.lktriTpx.mjs.map +0 -1
- package/dist/shared/curvy.mLFprrGm.mjs +0 -85
- package/dist/shared/curvy.mLFprrGm.mjs.map +0 -1
- package/dist/shared/curvy.r6f1j287.mjs +0 -76
- package/dist/shared/curvy.r6f1j287.mjs.map +0 -1
- package/dist/splines/basis2d.d.mts +0 -130
- package/dist/splines/basis2d.d.ts +0 -130
- package/dist/splines/basis2d.mjs +0 -90
- package/dist/splines/basis2d.mjs.map +0 -1
- package/dist/splines/bezier2d.d.mts +0 -182
- package/dist/splines/bezier2d.d.ts +0 -182
- package/dist/splines/bezier2d.mjs +0 -23
- package/dist/splines/bezier2d.mjs.map +0 -1
- package/dist/splines/cardinal2d.d.mts +0 -178
- package/dist/splines/cardinal2d.d.ts +0 -178
- package/dist/splines/cardinal2d.mjs +0 -114
- package/dist/splines/cardinal2d.mjs.map +0 -1
- package/dist/splines/hermite2d.d.mts +0 -124
- package/dist/splines/hermite2d.d.ts +0 -124
- package/dist/splines/hermite2d.mjs +0 -63
- package/dist/splines/hermite2d.mjs.map +0 -1
- package/dist/utils.d.ts +0 -205
- package/dist/vector/vector2.d.mts +0 -324
- package/dist/vector/vector2.d.ts +0 -324
- package/dist/vector/vector2.mjs +0 -30
- package/dist/vector/vector2.mjs.map +0 -1
- package/dist/vector/vector3.d.mts +0 -417
- package/dist/vector/vector3.d.ts +0 -417
- package/dist/vector/vector3.mjs +0 -38
- package/dist/vector/vector3.mjs.map +0 -1
- package/dist/vector/vector4.d.mts +0 -205
- package/dist/vector/vector4.d.ts +0 -205
- package/dist/vector/vector4.mjs +0 -20
- package/dist/vector/vector4.mjs.map +0 -1
|
@@ -1,417 +0,0 @@
|
|
|
1
|
-
import { g as ThreeDimensional } from '../shared/curvy.Bf5TIk31.mjs';
|
|
2
|
-
import { Pipeable } from '../pipe.mjs';
|
|
3
|
-
|
|
4
|
-
declare const Vector3TypeId: unique symbol;
|
|
5
|
-
type Vector3TypeId = typeof Vector3TypeId;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A 3D vector.
|
|
9
|
-
*
|
|
10
|
-
* All fields are readonly and immutable, and all operations create new instances.
|
|
11
|
-
*
|
|
12
|
-
* @since 1.0.0
|
|
13
|
-
*/
|
|
14
|
-
interface Vector3 extends Pipeable, ThreeDimensional<number> {
|
|
15
|
-
readonly [Vector3TypeId]: Vector3TypeId;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Checks if a value is a `Vector3`.
|
|
19
|
-
*
|
|
20
|
-
* @param v - The value to check.
|
|
21
|
-
* @returns `true` if the value is a `Vector3`, `false` otherwise.
|
|
22
|
-
* @since 1.0.0
|
|
23
|
-
*/
|
|
24
|
-
declare const isVector3: (v: unknown) => v is Vector3;
|
|
25
|
-
declare const make: {
|
|
26
|
-
/**
|
|
27
|
-
* Creates a new `Vector3` instance.
|
|
28
|
-
*
|
|
29
|
-
* @param xyz - The x, y, and z components of the vector.
|
|
30
|
-
* @returns A new `Vector3` instance.
|
|
31
|
-
* @since 1.0.0
|
|
32
|
-
*/
|
|
33
|
-
(xyz: number): Vector3;
|
|
34
|
-
/**
|
|
35
|
-
* Creates a new `Vector3` instance.
|
|
36
|
-
*
|
|
37
|
-
* @param x - The x component of the vector.
|
|
38
|
-
* @param yz - The y and z components of the vector.
|
|
39
|
-
* @returns A new `Vector3` instance.
|
|
40
|
-
* @since 1.0.0
|
|
41
|
-
*/
|
|
42
|
-
(x: number, yz: number): Vector3;
|
|
43
|
-
/**
|
|
44
|
-
* Creates a new `Vector3` instance.
|
|
45
|
-
*
|
|
46
|
-
* @param x - The x component of the vector.
|
|
47
|
-
* @param y - The y component of the vector.
|
|
48
|
-
* @param z - The z component of the vector.
|
|
49
|
-
* @returns A new `Vector3` instance.
|
|
50
|
-
* @since 1.0.0
|
|
51
|
-
*/
|
|
52
|
-
(x: number, y: number, z: number): Vector3;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Creates a new `Vector3` instance from spherical coordinates.
|
|
56
|
-
*
|
|
57
|
-
* @param r - The radius.
|
|
58
|
-
* @param theta - The polar angle, in radians. Ranges from 0 to π
|
|
59
|
-
* @param phi - The azimuthal angle, in radians. Ranges from 0 to 2π
|
|
60
|
-
* @returns A new `Vector3` instance.
|
|
61
|
-
* @since 1.0.0
|
|
62
|
-
*/
|
|
63
|
-
declare const fromSpherical: (r: number, theta: number, phi: number) => Vector3;
|
|
64
|
-
/**
|
|
65
|
-
* Calculates the magnitude of a `Vector3`.
|
|
66
|
-
*
|
|
67
|
-
* @param vector - The vector to calculate the magnitude of.
|
|
68
|
-
* @returns The magnitude of the vector.
|
|
69
|
-
* @since 1.0.0
|
|
70
|
-
*/
|
|
71
|
-
declare const magnitude: (vector: Vector3) => number;
|
|
72
|
-
/**
|
|
73
|
-
* Calculates the length of a `Vector3`.
|
|
74
|
-
*
|
|
75
|
-
* @param vector - The vector to calculate the length of.
|
|
76
|
-
* @returns The length of the vector.
|
|
77
|
-
* @see {@link magnitude}
|
|
78
|
-
* @since 1.0.0
|
|
79
|
-
*/
|
|
80
|
-
declare const length: (vector: Vector3) => number;
|
|
81
|
-
/**
|
|
82
|
-
* Normalizes a `Vector3`.
|
|
83
|
-
*
|
|
84
|
-
* @param vector - The vector to normalize.
|
|
85
|
-
* @returns A new `Vector3` instance with the same direction as the input vector, but with a magnitude of 1.
|
|
86
|
-
* @since 1.0.0
|
|
87
|
-
*/
|
|
88
|
-
declare const normalize: (vector: Vector3) => Vector3;
|
|
89
|
-
declare const dot: {
|
|
90
|
-
/**
|
|
91
|
-
* Calculates the dot product of two `Vector3` instances.
|
|
92
|
-
*
|
|
93
|
-
* @param a - The first vector.
|
|
94
|
-
* @param b - The second vector.
|
|
95
|
-
* @returns The dot product of the two vectors.
|
|
96
|
-
* @since 1.0.0
|
|
97
|
-
*/
|
|
98
|
-
(a: Vector3, b: Vector3): number;
|
|
99
|
-
/**
|
|
100
|
-
* Calculates the dot product of two `Vector3` instances.
|
|
101
|
-
*
|
|
102
|
-
* @param b - The second vector.
|
|
103
|
-
* @returns A function that takes the first vector and returns the dot product.
|
|
104
|
-
* @since 1.0.0
|
|
105
|
-
*/
|
|
106
|
-
(b: Vector3): (a: Vector3) => number;
|
|
107
|
-
};
|
|
108
|
-
declare const cross: {
|
|
109
|
-
/**
|
|
110
|
-
* Calculates the cross product of two `Vector3` instances.
|
|
111
|
-
*
|
|
112
|
-
* @param a - The first vector.
|
|
113
|
-
* @param b - The second vector.
|
|
114
|
-
* @returns A new `Vector3` instance representing the cross product of the two vectors.
|
|
115
|
-
* @since 1.0.0
|
|
116
|
-
*/
|
|
117
|
-
(a: Vector3, b: Vector3): Vector3;
|
|
118
|
-
/**
|
|
119
|
-
* Calculates the cross product of two `Vector3` instances.
|
|
120
|
-
*
|
|
121
|
-
* @param b - The second vector.
|
|
122
|
-
* @returns A function that takes the first vector and returns the cross product.
|
|
123
|
-
* @since 1.0.0
|
|
124
|
-
*/
|
|
125
|
-
(b: Vector3): (a: Vector3) => Vector3;
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* Returns the components of a `Vector3` as an array.
|
|
129
|
-
*
|
|
130
|
-
* @param v - The vector to get the components of.
|
|
131
|
-
* @returns An array containing the x, y, and z components of the vector.
|
|
132
|
-
* @since 1.0.0
|
|
133
|
-
*/
|
|
134
|
-
declare const components: (v: Vector3) => [number, number, number];
|
|
135
|
-
/**
|
|
136
|
-
* Calculates the softmax of a `Vector3`.
|
|
137
|
-
*
|
|
138
|
-
* @param v - The vector to calculate the softmax of.
|
|
139
|
-
* @returns A new `Vector3` instance representing the softmax of the input vector.
|
|
140
|
-
* @since 1.0.0
|
|
141
|
-
*/
|
|
142
|
-
declare const softmax: (v: Vector3) => Vector3;
|
|
143
|
-
/**
|
|
144
|
-
* Creates a zero vector.
|
|
145
|
-
*
|
|
146
|
-
* @since 1.0.0
|
|
147
|
-
*/
|
|
148
|
-
declare const zero: Vector3;
|
|
149
|
-
/**
|
|
150
|
-
* Creates a unit vector.
|
|
151
|
-
*
|
|
152
|
-
* @since 1.0.0
|
|
153
|
-
*/
|
|
154
|
-
declare const unit: Vector3;
|
|
155
|
-
/**
|
|
156
|
-
* Creates a unit vector in the x direction.
|
|
157
|
-
*
|
|
158
|
-
* @since 1.0.0
|
|
159
|
-
*/
|
|
160
|
-
declare const unitX: Vector3;
|
|
161
|
-
/**
|
|
162
|
-
* Creates a unit vector in the y direction.
|
|
163
|
-
*
|
|
164
|
-
* @since 1.0.0
|
|
165
|
-
*/
|
|
166
|
-
declare const unitY: Vector3;
|
|
167
|
-
/**
|
|
168
|
-
* Creates a unit vector in the z direction.
|
|
169
|
-
*
|
|
170
|
-
* @since 1.0.0
|
|
171
|
-
*/
|
|
172
|
-
declare const unitZ: Vector3;
|
|
173
|
-
declare const add: {
|
|
174
|
-
/**
|
|
175
|
-
* Adds two `Vector3` instances.
|
|
176
|
-
*
|
|
177
|
-
* @param a - The first vector.
|
|
178
|
-
* @param b - The second vector.
|
|
179
|
-
* @returns A new `Vector3` instance representing the sum of the two vectors.
|
|
180
|
-
* @since 1.0.0
|
|
181
|
-
*/
|
|
182
|
-
(a: Vector3, b: Vector3): Vector3;
|
|
183
|
-
/**
|
|
184
|
-
* Adds two `Vector3` instances.
|
|
185
|
-
*
|
|
186
|
-
* @param b - The second vector.
|
|
187
|
-
* @returns A function that takes the first vector and returns the sum.
|
|
188
|
-
* @since 1.0.0
|
|
189
|
-
*/
|
|
190
|
-
(b: Vector3): (a: Vector3) => Vector3;
|
|
191
|
-
};
|
|
192
|
-
declare const subtract: {
|
|
193
|
-
/**
|
|
194
|
-
* Subtracts one `Vector3` instance from another.
|
|
195
|
-
*
|
|
196
|
-
* @param a - The vector to subtract from.
|
|
197
|
-
* @param b - The vector to subtract.
|
|
198
|
-
* @returns A new `Vector3` instance representing the difference of the two vectors.
|
|
199
|
-
* @since 1.0.0
|
|
200
|
-
*/
|
|
201
|
-
(a: Vector3, b: Vector3): Vector3;
|
|
202
|
-
/**
|
|
203
|
-
* Subtracts one `Vector3` instance from another.
|
|
204
|
-
*
|
|
205
|
-
* @param b - The vector to subtract.
|
|
206
|
-
* @returns A function that takes the first vector and returns the difference.
|
|
207
|
-
* @since 1.0.0
|
|
208
|
-
*/
|
|
209
|
-
(b: Vector3): (a: Vector3) => Vector3;
|
|
210
|
-
};
|
|
211
|
-
declare const hadamard: {
|
|
212
|
-
/**
|
|
213
|
-
* Calculates the Hadamard product of two `Vector3` instances.
|
|
214
|
-
*
|
|
215
|
-
* The Hadamard product is an element-wise multiplication of two vectors.
|
|
216
|
-
*
|
|
217
|
-
* @param a - The first vector.
|
|
218
|
-
* @param b - The second vector.
|
|
219
|
-
* @returns A new `Vector3` instance representing the Hadamard product of the two vectors.
|
|
220
|
-
* @since 1.0.0
|
|
221
|
-
*/
|
|
222
|
-
(a: Vector3, b: Vector3): Vector3;
|
|
223
|
-
/**
|
|
224
|
-
* Calculates the Hadamard product of two `Vector3` instances.
|
|
225
|
-
*
|
|
226
|
-
* The Hadamard product is an element-wise multiplication of two vectors.
|
|
227
|
-
*
|
|
228
|
-
* @param b - The second vector.
|
|
229
|
-
* @returns A function that takes the first vector and returns the Hadamard product.
|
|
230
|
-
* @since 1.0.0
|
|
231
|
-
*/
|
|
232
|
-
(b: Vector3): (a: Vector3) => Vector3;
|
|
233
|
-
};
|
|
234
|
-
declare const scale: {
|
|
235
|
-
/**
|
|
236
|
-
* Scales a `Vector3` instance by a scalar value.
|
|
237
|
-
*
|
|
238
|
-
* @param s - The scalar value to scale by.
|
|
239
|
-
* @return A function that takes a vector and returns the scaled vector.
|
|
240
|
-
* @since 1.0.0
|
|
241
|
-
*/
|
|
242
|
-
(s: number): (v: Vector3) => Vector3;
|
|
243
|
-
/**
|
|
244
|
-
* Scales a `Vector3` instance by a scalar value.
|
|
245
|
-
*
|
|
246
|
-
* @param s - The scalar value to scale by.
|
|
247
|
-
* @param v - The vector to scale.
|
|
248
|
-
* @returns A new `Vector3` instance representing the scaled vector.
|
|
249
|
-
* @since 1.0.0
|
|
250
|
-
*/
|
|
251
|
-
(v: Vector3, s: number): Vector3;
|
|
252
|
-
};
|
|
253
|
-
/**
|
|
254
|
-
* Gets the x component of a `Vector3`.
|
|
255
|
-
*
|
|
256
|
-
* @param v - The vector to get the x component of.
|
|
257
|
-
* @returns The x component of the vector.
|
|
258
|
-
* @since 1.0.0
|
|
259
|
-
*/
|
|
260
|
-
declare const getX: (v: Vector3) => number;
|
|
261
|
-
declare const setX: {
|
|
262
|
-
/**
|
|
263
|
-
* Sets the x component of a `Vector3`.
|
|
264
|
-
*
|
|
265
|
-
* @param v - The vector to set the x component of.
|
|
266
|
-
* @param x - The new x component.
|
|
267
|
-
* @returns A new `Vector3` instance with the updated x component.
|
|
268
|
-
* @since 1.0.0
|
|
269
|
-
*/
|
|
270
|
-
(v: Vector3, x: number): Vector3;
|
|
271
|
-
/**
|
|
272
|
-
* Sets the x component of a `Vector3`.
|
|
273
|
-
*
|
|
274
|
-
* @param x - The new x component.
|
|
275
|
-
* @returns A function that takes the vector and returns a new `Vector3` instance with the updated x component.
|
|
276
|
-
* @since 1.0.0
|
|
277
|
-
*/
|
|
278
|
-
(x: number): (v: Vector3) => Vector3;
|
|
279
|
-
};
|
|
280
|
-
/**
|
|
281
|
-
* Gets the y component of a `Vector3`.
|
|
282
|
-
*
|
|
283
|
-
* @param v - The vector of which to get the y component.
|
|
284
|
-
* @returns The y component of the vector.
|
|
285
|
-
* @since 1.0.0
|
|
286
|
-
*/
|
|
287
|
-
declare const getY: (v: Vector3) => number;
|
|
288
|
-
declare const setY: {
|
|
289
|
-
/**
|
|
290
|
-
* Sets the y component of a `Vector3`.
|
|
291
|
-
*
|
|
292
|
-
* @param v - The vector of which to set the y component.
|
|
293
|
-
* @param y - The new y component.
|
|
294
|
-
* @returns A new `Vector3` instance with the updated y component.
|
|
295
|
-
* @since 1.0.0
|
|
296
|
-
*/
|
|
297
|
-
(v: Vector3, y: number): Vector3;
|
|
298
|
-
/**
|
|
299
|
-
* Sets the y component of a `Vector3`.
|
|
300
|
-
*
|
|
301
|
-
* @param y - The new y component.
|
|
302
|
-
* @returns A function that takes the vector and returns a new `Vector3` instance with the updated y component.
|
|
303
|
-
* @since 1.0.0
|
|
304
|
-
*/
|
|
305
|
-
(y: number): (v: Vector3) => Vector3;
|
|
306
|
-
};
|
|
307
|
-
/**
|
|
308
|
-
* Gets the z component of a `Vector3`.
|
|
309
|
-
*
|
|
310
|
-
* @param v - The vector of which to get the z component.
|
|
311
|
-
* @returns The z component of the vector.
|
|
312
|
-
* @since 1.0.0
|
|
313
|
-
*/
|
|
314
|
-
declare const getZ: (v: Vector3) => number;
|
|
315
|
-
declare const setZ: {
|
|
316
|
-
/**
|
|
317
|
-
* Sets the z component of a `Vector3`.
|
|
318
|
-
*
|
|
319
|
-
* @param v - The vector of which to set the z component.
|
|
320
|
-
* @param z - The new z component.
|
|
321
|
-
* @returns A new `Vector3` instance with the updated z component.
|
|
322
|
-
* @since 1.0.0
|
|
323
|
-
*/
|
|
324
|
-
(v: Vector3, z: number): Vector3;
|
|
325
|
-
/**
|
|
326
|
-
* Sets the z component of a `Vector3`.
|
|
327
|
-
*
|
|
328
|
-
* @param z - The new z component.
|
|
329
|
-
* @returns A function that takes the vector and returns a new `Vector3` instance with the updated z component.
|
|
330
|
-
* @since 1.0.0
|
|
331
|
-
*/
|
|
332
|
-
(z: number): (v: Vector3) => Vector3;
|
|
333
|
-
};
|
|
334
|
-
/**
|
|
335
|
-
* Gets the radius of a `Vector3`.
|
|
336
|
-
*
|
|
337
|
-
* @param v - The vector of which to get the radius.
|
|
338
|
-
* @returns The radius of the vector.
|
|
339
|
-
* @since 1.0.0
|
|
340
|
-
*/
|
|
341
|
-
declare const getR: (v: Vector3) => number;
|
|
342
|
-
declare const setR: {
|
|
343
|
-
/**
|
|
344
|
-
* Sets the radius of a `Vector3`.
|
|
345
|
-
*
|
|
346
|
-
* @param v - The vector of which to set the radius.
|
|
347
|
-
* @param r - The new radius.
|
|
348
|
-
* @returns A new `Vector3` instance with the updated radius.
|
|
349
|
-
* @since 1.0.0
|
|
350
|
-
*/
|
|
351
|
-
(v: Vector3, r: number): Vector3;
|
|
352
|
-
/**
|
|
353
|
-
* Sets the radius of a `Vector3`.
|
|
354
|
-
*
|
|
355
|
-
* @param r - The new radius.
|
|
356
|
-
* @returns A function that takes the vector and returns the updated vector.
|
|
357
|
-
* @since 1.0.0
|
|
358
|
-
*/
|
|
359
|
-
(r: number): (v: Vector3) => Vector3;
|
|
360
|
-
};
|
|
361
|
-
/**
|
|
362
|
-
* Gets the polar angle (theta) of a `Vector3`.
|
|
363
|
-
*
|
|
364
|
-
* @param v - The vector of which to get the polar angle.
|
|
365
|
-
* @returns The polar angle of the vector.
|
|
366
|
-
* @since 1.0.0
|
|
367
|
-
*/
|
|
368
|
-
declare const getTheta: (v: Vector3) => number;
|
|
369
|
-
declare const setTheta: {
|
|
370
|
-
/**
|
|
371
|
-
* Sets the polar angle (theta) of a `Vector3`.
|
|
372
|
-
*
|
|
373
|
-
* @param v - The vector of which to set the polar angle.
|
|
374
|
-
* @param theta - The new polar angle.
|
|
375
|
-
* @returns A new `Vector3` instance with the updated polar angle.
|
|
376
|
-
* @since 1.0.0
|
|
377
|
-
*/
|
|
378
|
-
(v: Vector3, theta: number): Vector3;
|
|
379
|
-
/**
|
|
380
|
-
* Sets the polar angle (theta) of a `Vector3`.
|
|
381
|
-
*
|
|
382
|
-
* @param theta - The new polar angle.
|
|
383
|
-
* @returns A function that takes the vector and returns the updated vector.
|
|
384
|
-
* @since 1.0.0
|
|
385
|
-
*/
|
|
386
|
-
(theta: number): (v: Vector3) => Vector3;
|
|
387
|
-
};
|
|
388
|
-
/**
|
|
389
|
-
* Gets the azimuthal angle (phi) of a `Vector3`.
|
|
390
|
-
*
|
|
391
|
-
* @param v - The vector of which to get the azimuthal angle.
|
|
392
|
-
* @returns The azimuthal angle of the vector.
|
|
393
|
-
* @since 1.0.0
|
|
394
|
-
*/
|
|
395
|
-
declare const getPhi: (v: Vector3) => number;
|
|
396
|
-
declare const setPhi: {
|
|
397
|
-
/**
|
|
398
|
-
* Sets the azimuthal angle (phi) of a `Vector3`.
|
|
399
|
-
*
|
|
400
|
-
* @param v - The vector of which to set the azimuthal angle.
|
|
401
|
-
* @param phi - The new azimuthal angle.
|
|
402
|
-
* @returns A new `Vector3` instance with the updated azimuthal angle.
|
|
403
|
-
* @since 1.0.0
|
|
404
|
-
*/
|
|
405
|
-
(v: Vector3, phi: number): Vector3;
|
|
406
|
-
/**
|
|
407
|
-
* Sets the azimuthal angle (phi) of a `Vector3`.
|
|
408
|
-
*
|
|
409
|
-
* @param phi - The new azimuthal angle.
|
|
410
|
-
* @returns A function that takes the vector and returns the updated vector.
|
|
411
|
-
* @since 1.0.0
|
|
412
|
-
*/
|
|
413
|
-
(phi: number): (v: Vector3) => Vector3;
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
export { add, components, cross, dot, fromSpherical, getPhi, getR, getTheta, getX, getY, getZ, hadamard, isVector3, length, magnitude, make, normalize, scale, setPhi, setR, setTheta, setX, setY, setZ, softmax, subtract, unit, unitX, unitY, unitZ, zero };
|
|
417
|
-
export type { Vector3 };
|