@mlightcad/geometry-engine 1.0.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 (149) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -0
  3. package/dist/geometry-engine.js +10186 -0
  4. package/dist/geometry-engine.umd.cjs +4 -0
  5. package/lib/geometry/AcGeArea2d.d.ts +61 -0
  6. package/lib/geometry/AcGeArea2d.d.ts.map +1 -0
  7. package/lib/geometry/AcGeArea2d.js +174 -0
  8. package/lib/geometry/AcGeArea2d.js.map +1 -0
  9. package/lib/geometry/AcGeCircArc2d.d.ts +108 -0
  10. package/lib/geometry/AcGeCircArc2d.d.ts.map +1 -0
  11. package/lib/geometry/AcGeCircArc2d.js +412 -0
  12. package/lib/geometry/AcGeCircArc2d.js.map +1 -0
  13. package/lib/geometry/AcGeCircArc3d.d.ts +138 -0
  14. package/lib/geometry/AcGeCircArc3d.d.ts.map +1 -0
  15. package/lib/geometry/AcGeCircArc3d.js +447 -0
  16. package/lib/geometry/AcGeCircArc3d.js.map +1 -0
  17. package/lib/geometry/AcGeCurve2d.d.ts +85 -0
  18. package/lib/geometry/AcGeCurve2d.d.ts.map +1 -0
  19. package/lib/geometry/AcGeCurve2d.js +213 -0
  20. package/lib/geometry/AcGeCurve2d.js.map +1 -0
  21. package/lib/geometry/AcGeCurve3d.d.ts +27 -0
  22. package/lib/geometry/AcGeCurve3d.d.ts.map +1 -0
  23. package/lib/geometry/AcGeCurve3d.js +29 -0
  24. package/lib/geometry/AcGeCurve3d.js.map +1 -0
  25. package/lib/geometry/AcGeEllipseArc2d.d.ts +105 -0
  26. package/lib/geometry/AcGeEllipseArc2d.d.ts.map +1 -0
  27. package/lib/geometry/AcGeEllipseArc2d.js +292 -0
  28. package/lib/geometry/AcGeEllipseArc2d.js.map +1 -0
  29. package/lib/geometry/AcGeEllipseArc3d.d.ts +141 -0
  30. package/lib/geometry/AcGeEllipseArc3d.d.ts.map +1 -0
  31. package/lib/geometry/AcGeEllipseArc3d.js +442 -0
  32. package/lib/geometry/AcGeEllipseArc3d.js.map +1 -0
  33. package/lib/geometry/AcGeLine2d.d.ts +56 -0
  34. package/lib/geometry/AcGeLine2d.d.ts.map +1 -0
  35. package/lib/geometry/AcGeLine2d.js +125 -0
  36. package/lib/geometry/AcGeLine2d.js.map +1 -0
  37. package/lib/geometry/AcGeLine3d.d.ts +134 -0
  38. package/lib/geometry/AcGeLine3d.d.ts.map +1 -0
  39. package/lib/geometry/AcGeLine3d.js +291 -0
  40. package/lib/geometry/AcGeLine3d.js.map +1 -0
  41. package/lib/geometry/AcGeLoop2d.d.ts +59 -0
  42. package/lib/geometry/AcGeLoop2d.d.ts.map +1 -0
  43. package/lib/geometry/AcGeLoop2d.js +141 -0
  44. package/lib/geometry/AcGeLoop2d.js.map +1 -0
  45. package/lib/geometry/AcGePolyline2d.d.ts +90 -0
  46. package/lib/geometry/AcGePolyline2d.d.ts.map +1 -0
  47. package/lib/geometry/AcGePolyline2d.js +224 -0
  48. package/lib/geometry/AcGePolyline2d.js.map +1 -0
  49. package/lib/geometry/AcGeShape.d.ts +12 -0
  50. package/lib/geometry/AcGeShape.d.ts.map +1 -0
  51. package/lib/geometry/AcGeShape.js +22 -0
  52. package/lib/geometry/AcGeShape.js.map +1 -0
  53. package/lib/geometry/AcGeShape2d.d.ts +31 -0
  54. package/lib/geometry/AcGeShape2d.d.ts.map +1 -0
  55. package/lib/geometry/AcGeShape2d.js +51 -0
  56. package/lib/geometry/AcGeShape2d.js.map +1 -0
  57. package/lib/geometry/AcGeShape3d.d.ts +33 -0
  58. package/lib/geometry/AcGeShape3d.d.ts.map +1 -0
  59. package/lib/geometry/AcGeShape3d.js +52 -0
  60. package/lib/geometry/AcGeShape3d.js.map +1 -0
  61. package/lib/geometry/AcGeSpline3d.d.ts +77 -0
  62. package/lib/geometry/AcGeSpline3d.d.ts.map +1 -0
  63. package/lib/geometry/AcGeSpline3d.js +221 -0
  64. package/lib/geometry/AcGeSpline3d.js.map +1 -0
  65. package/lib/geometry/index.d.ts +13 -0
  66. package/lib/geometry/index.d.ts.map +1 -0
  67. package/lib/geometry/index.js +13 -0
  68. package/lib/geometry/index.js.map +1 -0
  69. package/lib/index.d.ts +4 -0
  70. package/lib/index.d.ts.map +1 -0
  71. package/lib/index.js +4 -0
  72. package/lib/index.js.map +1 -0
  73. package/lib/math/AcGeBox2d.d.ts +173 -0
  74. package/lib/math/AcGeBox2d.d.ts.map +1 -0
  75. package/lib/math/AcGeBox2d.js +289 -0
  76. package/lib/math/AcGeBox2d.js.map +1 -0
  77. package/lib/math/AcGeBox3d.d.ts +195 -0
  78. package/lib/math/AcGeBox3d.d.ts.map +1 -0
  79. package/lib/math/AcGeBox3d.js +378 -0
  80. package/lib/math/AcGeBox3d.js.map +1 -0
  81. package/lib/math/AcGeEuler.d.ts +133 -0
  82. package/lib/math/AcGeEuler.d.ts.map +1 -0
  83. package/lib/math/AcGeEuler.js +358 -0
  84. package/lib/math/AcGeEuler.js.map +1 -0
  85. package/lib/math/AcGeMatrix2d.d.ts +203 -0
  86. package/lib/math/AcGeMatrix2d.d.ts.map +1 -0
  87. package/lib/math/AcGeMatrix2d.js +393 -0
  88. package/lib/math/AcGeMatrix2d.js.map +1 -0
  89. package/lib/math/AcGeMatrix3d.d.ts +279 -0
  90. package/lib/math/AcGeMatrix3d.d.ts.map +1 -0
  91. package/lib/math/AcGeMatrix3d.js +1037 -0
  92. package/lib/math/AcGeMatrix3d.js.map +1 -0
  93. package/lib/math/AcGePlane.d.ts +131 -0
  94. package/lib/math/AcGePlane.d.ts.map +1 -0
  95. package/lib/math/AcGePlane.js +218 -0
  96. package/lib/math/AcGePlane.js.map +1 -0
  97. package/lib/math/AcGePoint.d.ts +4 -0
  98. package/lib/math/AcGePoint.d.ts.map +1 -0
  99. package/lib/math/AcGePoint.js +2 -0
  100. package/lib/math/AcGePoint.js.map +1 -0
  101. package/lib/math/AcGePoint2d.d.ts +17 -0
  102. package/lib/math/AcGePoint2d.d.ts.map +1 -0
  103. package/lib/math/AcGePoint2d.js +40 -0
  104. package/lib/math/AcGePoint2d.js.map +1 -0
  105. package/lib/math/AcGePoint3d.d.ts +18 -0
  106. package/lib/math/AcGePoint3d.d.ts.map +1 -0
  107. package/lib/math/AcGePoint3d.js +43 -0
  108. package/lib/math/AcGePoint3d.js.map +1 -0
  109. package/lib/math/AcGeQuaternion.d.ts +230 -0
  110. package/lib/math/AcGeQuaternion.d.ts.map +1 -0
  111. package/lib/math/AcGeQuaternion.js +666 -0
  112. package/lib/math/AcGeQuaternion.js.map +1 -0
  113. package/lib/math/AcGeVector.d.ts +9 -0
  114. package/lib/math/AcGeVector.d.ts.map +1 -0
  115. package/lib/math/AcGeVector.js +2 -0
  116. package/lib/math/AcGeVector.js.map +1 -0
  117. package/lib/math/AcGeVector2d.d.ts +361 -0
  118. package/lib/math/AcGeVector2d.d.ts.map +1 -0
  119. package/lib/math/AcGeVector2d.js +622 -0
  120. package/lib/math/AcGeVector2d.js.map +1 -0
  121. package/lib/math/AcGeVector3d.d.ts +493 -0
  122. package/lib/math/AcGeVector3d.d.ts.map +1 -0
  123. package/lib/math/AcGeVector3d.js +868 -0
  124. package/lib/math/AcGeVector3d.js.map +1 -0
  125. package/lib/math/index.d.ts +14 -0
  126. package/lib/math/index.d.ts.map +1 -0
  127. package/lib/math/index.js +14 -0
  128. package/lib/math/index.js.map +1 -0
  129. package/lib/util/AcGeConstants.d.ts +19 -0
  130. package/lib/util/AcGeConstants.d.ts.map +1 -0
  131. package/lib/util/AcGeConstants.js +25 -0
  132. package/lib/util/AcGeConstants.js.map +1 -0
  133. package/lib/util/AcGeGeometryUtil.d.ts +16 -0
  134. package/lib/util/AcGeGeometryUtil.d.ts.map +1 -0
  135. package/lib/util/AcGeGeometryUtil.js +56 -0
  136. package/lib/util/AcGeGeometryUtil.js.map +1 -0
  137. package/lib/util/AcGeMathUtil.d.ts +203 -0
  138. package/lib/util/AcGeMathUtil.d.ts.map +1 -0
  139. package/lib/util/AcGeMathUtil.js +585 -0
  140. package/lib/util/AcGeMathUtil.js.map +1 -0
  141. package/lib/util/AcGeTol.d.ts +91 -0
  142. package/lib/util/AcGeTol.d.ts.map +1 -0
  143. package/lib/util/AcGeTol.js +83 -0
  144. package/lib/util/AcGeTol.js.map +1 -0
  145. package/lib/util/index.d.ts +5 -0
  146. package/lib/util/index.d.ts.map +1 -0
  147. package/lib/util/index.js +5 -0
  148. package/lib/util/index.js.map +1 -0
  149. package/package.json +42 -0
@@ -0,0 +1,622 @@
1
+ var __generator = (this && this.__generator) || function (thisArg, body) {
2
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
3
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
4
+ function verb(n) { return function (v) { return step([n, v]); }; }
5
+ function step(op) {
6
+ if (f) throw new TypeError("Generator is already executing.");
7
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
8
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
9
+ if (y = 0, t) op = [op[0] & 2, t.value];
10
+ switch (op[0]) {
11
+ case 0: case 1: t = op; break;
12
+ case 4: _.label++; return { value: op[1], done: false };
13
+ case 5: _.label++; y = op[1]; op = [0]; continue;
14
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
15
+ default:
16
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
17
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
18
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
19
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
20
+ if (t[2]) _.ops.pop();
21
+ _.trys.pop(); continue;
22
+ }
23
+ op = body.call(thisArg, _);
24
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
25
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
26
+ }
27
+ };
28
+ import { AcCmErrors } from '@mlightcad/common';
29
+ import { AcGeMathUtil } from '../util/AcGeMathUtil';
30
+ /**
31
+ * The class representing a 2d vector.
32
+ */
33
+ var AcGeVector2d = /** @class */ (function () {
34
+ /**
35
+ * Construct one vector by two numbers
36
+ */
37
+ function AcGeVector2d(a, b) {
38
+ this.x = 0;
39
+ this.y = 0;
40
+ var argsLength = +(a !== undefined) + +(b !== undefined);
41
+ if (argsLength === 0) {
42
+ return;
43
+ }
44
+ if (argsLength === 1 && a instanceof Array) {
45
+ this.x = a[0];
46
+ this.y = a[1];
47
+ return;
48
+ }
49
+ if (argsLength === 1) {
50
+ var _a = a, x = _a.x, y = _a.y;
51
+ this.x = x;
52
+ this.y = y;
53
+ return;
54
+ }
55
+ if (argsLength === 2) {
56
+ this.x = a;
57
+ this.y = b;
58
+ return;
59
+ }
60
+ throw AcCmErrors.ILLEGAL_PARAMETERS;
61
+ }
62
+ Object.defineProperty(AcGeVector2d.prototype, "width", {
63
+ /**
64
+ * Alias for x.
65
+ */
66
+ get: function () {
67
+ return this.x;
68
+ },
69
+ set: function (value) {
70
+ this.x = value;
71
+ },
72
+ enumerable: false,
73
+ configurable: true
74
+ });
75
+ Object.defineProperty(AcGeVector2d.prototype, "height", {
76
+ /**
77
+ * Alias for y.
78
+ */
79
+ get: function () {
80
+ return this.y;
81
+ },
82
+ set: function (value) {
83
+ this.y = value;
84
+ },
85
+ enumerable: false,
86
+ configurable: true
87
+ });
88
+ /**
89
+ * Sets the x and y components of this vector.
90
+ * @param x Input x component of this vector
91
+ * @param y Input y component of this vector
92
+ * @returns Return this vector
93
+ */
94
+ AcGeVector2d.prototype.set = function (x, y) {
95
+ this.x = x;
96
+ this.y = y;
97
+ return this;
98
+ };
99
+ /**
100
+ * Set the x and y values of this vector both equal to scalar.
101
+ * @param scalar Input one scalar value
102
+ * @returns Return this vector
103
+ */
104
+ AcGeVector2d.prototype.setScalar = function (scalar) {
105
+ this.x = scalar;
106
+ this.y = scalar;
107
+ return this;
108
+ };
109
+ /**
110
+ * Replace this vector's x value with x.
111
+ * @param x Input new value of x component of this vector
112
+ * @returns Return this vector
113
+ */
114
+ AcGeVector2d.prototype.setX = function (x) {
115
+ this.x = x;
116
+ return this;
117
+ };
118
+ /**
119
+ * Replace this vector's y value with y.
120
+ * @param y Input new value of y component of this vector
121
+ * @returns Return this vector
122
+ */
123
+ AcGeVector2d.prototype.setY = function (y) {
124
+ this.y = y;
125
+ return this;
126
+ };
127
+ /**
128
+ * If index equals 0 set x to value.
129
+ * If index equals 1 set y to value
130
+ * @param index 0 or 1.
131
+ * @param value Input one number
132
+ * @returns Return this vector
133
+ */
134
+ AcGeVector2d.prototype.setComponent = function (index, value) {
135
+ switch (index) {
136
+ case 0:
137
+ this.x = value;
138
+ break;
139
+ case 1:
140
+ this.y = value;
141
+ break;
142
+ default:
143
+ throw new Error('index is out of range: ' + index);
144
+ }
145
+ return this;
146
+ };
147
+ /**
148
+ * If index equals 0 returns the x value.
149
+ * If index equals 1 returns the y value.
150
+ * @param index 0 or 1.
151
+ * @returns Return this matrix
152
+ */
153
+ AcGeVector2d.prototype.getComponent = function (index) {
154
+ switch (index) {
155
+ case 0:
156
+ return this.x;
157
+ case 1:
158
+ return this.y;
159
+ default:
160
+ throw new Error('index is out of range: ' + index);
161
+ }
162
+ };
163
+ /**
164
+ * Return a new 2d vector with the same x and y values as this one.
165
+ * @returns Return the cloned vector
166
+ */
167
+ AcGeVector2d.prototype.clone = function () {
168
+ return new AcGeVector2d(this.x, this.y);
169
+ };
170
+ /**
171
+ * Copy the values of the passed vector's x and y properties to this vector.
172
+ * @param v Input one 2d vector
173
+ * @returns Return this vector
174
+ */
175
+ AcGeVector2d.prototype.copy = function (v) {
176
+ this.x = v.x;
177
+ this.y = v.y;
178
+ return this;
179
+ };
180
+ /**
181
+ * Add v to this vector.
182
+ * @param v Input one 2d vector
183
+ * @returns Return this vector
184
+ */
185
+ AcGeVector2d.prototype.add = function (v) {
186
+ this.x += v.x;
187
+ this.y += v.y;
188
+ return this;
189
+ };
190
+ /**
191
+ * Add the scalar value s to this vector's x and y values.
192
+ * @param s Input one scalar value
193
+ * @returns Return this vector
194
+ */
195
+ AcGeVector2d.prototype.addScalar = function (s) {
196
+ this.x += s;
197
+ this.y += s;
198
+ return this;
199
+ };
200
+ /**
201
+ * Set this vector to a + b.
202
+ * @param a Input one 2d vector
203
+ * @param b Input one 2d vector
204
+ * @returns Return this vector
205
+ */
206
+ AcGeVector2d.prototype.addVectors = function (a, b) {
207
+ this.x = a.x + b.x;
208
+ this.y = a.y + b.y;
209
+ return this;
210
+ };
211
+ /**
212
+ * Add the multiple of v and s to this vector.
213
+ * @param v Input one 2d vector
214
+ * @param s Input one scalar value
215
+ * @returns Return this vector
216
+ */
217
+ AcGeVector2d.prototype.addScaledVector = function (v, s) {
218
+ this.x += v.x * s;
219
+ this.y += v.y * s;
220
+ return this;
221
+ };
222
+ /**
223
+ * Subtract v from this vector.
224
+ * @param v Input one 2d vector
225
+ * @returns Return this vector
226
+ */
227
+ AcGeVector2d.prototype.sub = function (v) {
228
+ this.x -= v.x;
229
+ this.y -= v.y;
230
+ return this;
231
+ };
232
+ /**
233
+ * Subtract s from this vector's x and y components.
234
+ * @param s Input one scalar value
235
+ * @returns Return this vector
236
+ */
237
+ AcGeVector2d.prototype.subScalar = function (s) {
238
+ this.x -= s;
239
+ this.y -= s;
240
+ return this;
241
+ };
242
+ /**
243
+ * Sets this vector to a - b.
244
+ * @param a Input one 2d vector
245
+ * @param b Input one 2d vector
246
+ * @returns Return this vector
247
+ */
248
+ AcGeVector2d.prototype.subVectors = function (a, b) {
249
+ this.x = a.x - b.x;
250
+ this.y = a.y - b.y;
251
+ return this;
252
+ };
253
+ /**
254
+ * Multiply this vector by v.
255
+ * @param v Input one 2d vector
256
+ * @returns Return this vector
257
+ */
258
+ AcGeVector2d.prototype.multiply = function (v) {
259
+ this.x *= v.x;
260
+ this.y *= v.y;
261
+ return this;
262
+ };
263
+ /**
264
+ * Multiply this vector by scalar s.
265
+ * @param scalar Input one scalar value
266
+ * @returns Return this vector
267
+ */
268
+ AcGeVector2d.prototype.multiplyScalar = function (scalar) {
269
+ this.x *= scalar;
270
+ this.y *= scalar;
271
+ return this;
272
+ };
273
+ /**
274
+ * Divide this vector by v.
275
+ * @param v Input one 2d vector
276
+ * @returns Return this vector
277
+ */
278
+ AcGeVector2d.prototype.divide = function (v) {
279
+ this.x /= v.x;
280
+ this.y /= v.y;
281
+ return this;
282
+ };
283
+ /**
284
+ * Divide this vector by scalar s.
285
+ * @param scalar Input one scalar value
286
+ * @returns Return this vector
287
+ */
288
+ AcGeVector2d.prototype.divideScalar = function (scalar) {
289
+ return this.multiplyScalar(1 / scalar);
290
+ };
291
+ /**
292
+ * Multiply this vector (with an implicit 1 as the 3rd component) by m.
293
+ * @param m Input one 3x3 matrix
294
+ * @returns Return this vector
295
+ */
296
+ AcGeVector2d.prototype.applyMatrix2d = function (m) {
297
+ var x = this.x, y = this.y;
298
+ var e = m.elements;
299
+ this.x = e[0] * x + e[3] * y + e[6];
300
+ this.y = e[1] * x + e[4] * y + e[7];
301
+ return this;
302
+ };
303
+ /**
304
+ * If this vector's x or y value is greater than v's x or y value, replace that value with the
305
+ * corresponding min value.
306
+ * @param v Input one 2d vector
307
+ * @returns Return this vector
308
+ */
309
+ AcGeVector2d.prototype.min = function (v) {
310
+ this.x = Math.min(this.x, v.x);
311
+ this.y = Math.min(this.y, v.y);
312
+ return this;
313
+ };
314
+ /**
315
+ * If this vector's x or y value is less than v's x or y value, replace that value with the
316
+ * corresponding max value.
317
+ * @param v Input one 2d vector
318
+ * @returns Return this vector
319
+ */
320
+ AcGeVector2d.prototype.max = function (v) {
321
+ this.x = Math.max(this.x, v.x);
322
+ this.y = Math.max(this.y, v.y);
323
+ return this;
324
+ };
325
+ /**
326
+ * If this vector's x or y value is greater than the max vector's x or y value, it is replaced
327
+ * by the corresponding value.
328
+ * If this vector's x or y value is less than the min vector's x or y value, it is replaced by
329
+ * the corresponding value.
330
+ * @param min Input the minimum x and y values
331
+ * @param max Input the maximum x and y values in the desired range
332
+ * @returns
333
+ */
334
+ AcGeVector2d.prototype.clamp = function (min, max) {
335
+ // assumes min < max, componentwise
336
+ this.x = Math.max(min.x, Math.min(max.x, this.x));
337
+ this.y = Math.max(min.y, Math.min(max.y, this.y));
338
+ return this;
339
+ };
340
+ /**
341
+ * If this vector's x or y values are greater than the max value, they are replaced by the max value.
342
+ * If this vector's x or y values are less than the min value, they are replaced by the min value.
343
+ * @param minVal Input the minimum value the components will be clamped to
344
+ * @param maxVal Input the maximum value the length will be clamped to
345
+ * @returns Return this vector
346
+ */
347
+ AcGeVector2d.prototype.clampScalar = function (minVal, maxVal) {
348
+ this.x = Math.max(minVal, Math.min(maxVal, this.x));
349
+ this.y = Math.max(minVal, Math.min(maxVal, this.y));
350
+ return this;
351
+ };
352
+ /**
353
+ * If this vector's length is greater than the max value, it is replaced by the max value.
354
+ * If this vector's length is less than the min value, it is replaced by the min value.
355
+ * @param min Input the minimum value the length will be clamped to
356
+ * @param max Input the maximum value the length will be clamped to
357
+ * @returns Return this vector
358
+ */
359
+ AcGeVector2d.prototype.clampLength = function (min, max) {
360
+ var length = this.length();
361
+ return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));
362
+ };
363
+ /**
364
+ * The components of this vector are rounded down to the nearest integer value.
365
+ * @returns Return this vector
366
+ */
367
+ AcGeVector2d.prototype.floor = function () {
368
+ this.x = Math.floor(this.x);
369
+ this.y = Math.floor(this.y);
370
+ return this;
371
+ };
372
+ /**
373
+ * The x and y components of this vector are rounded up to the nearest integer value.
374
+ * @returns Return this vector
375
+ */
376
+ AcGeVector2d.prototype.ceil = function () {
377
+ this.x = Math.ceil(this.x);
378
+ this.y = Math.ceil(this.y);
379
+ return this;
380
+ };
381
+ /**
382
+ * The components of this vector are rounded to the nearest integer value.
383
+ * @returns Return this vector
384
+ */
385
+ AcGeVector2d.prototype.round = function () {
386
+ this.x = Math.round(this.x);
387
+ this.y = Math.round(this.y);
388
+ return this;
389
+ };
390
+ /**
391
+ * The components of this vector are rounded towards zero (up if negative, down if positive) to
392
+ * an integer value.
393
+ * @returns Return this vector
394
+ */
395
+ AcGeVector2d.prototype.roundToZero = function () {
396
+ this.x = Math.trunc(this.x);
397
+ this.y = Math.trunc(this.y);
398
+ return this;
399
+ };
400
+ /**
401
+ * Invert this vector - i.e. sets x = -x and y = -y.
402
+ * @returns Return this vector
403
+ */
404
+ AcGeVector2d.prototype.negate = function () {
405
+ this.x = -this.x;
406
+ this.y = -this.y;
407
+ return this;
408
+ };
409
+ /**
410
+ * Calculate the dot product of this vector and v.
411
+ * @param v Input one 2d vector
412
+ * @returns Return the dot product of this vector and v.
413
+ */
414
+ AcGeVector2d.prototype.dot = function (v) {
415
+ return this.x * v.x + this.y * v.y;
416
+ };
417
+ /**
418
+ * Calculate the cross product of this vector and v. Note that a 'cross-product' in 2D is not
419
+ * well-defined. This function computes a geometric cross-product often used in 2D graphics.
420
+ * @param v Input one 2d vector
421
+ * @returns Return the cross product of this vector and v.
422
+ */
423
+ AcGeVector2d.prototype.cross = function (v) {
424
+ return this.x * v.y - this.y * v.x;
425
+ };
426
+ /**
427
+ * Compute the square of the Euclidean length (straight-line length) from (0, 0) to (x, y).
428
+ * If you are comparing the lengths of vectors, you should compare the length squared instead
429
+ * as it is slightly more efficient to calculate.
430
+ * @returns Return the square of the Euclidean length (straight-line length) from (0, 0) to (x, y)
431
+ */
432
+ AcGeVector2d.prototype.lengthSq = function () {
433
+ return this.x * this.x + this.y * this.y;
434
+ };
435
+ /**
436
+ * Compute the Euclidean length (straight-line length) from (0, 0) to (x, y).
437
+ * @returns Return the Euclidean length (straight-line length) from (0, 0) to (x, y).
438
+ */
439
+ AcGeVector2d.prototype.length = function () {
440
+ return Math.sqrt(this.x * this.x + this.y * this.y);
441
+ };
442
+ /**
443
+ * Compute the Manhattan length of this vector.
444
+ * @returns Return the Manhattan length of this vector。
445
+ */
446
+ AcGeVector2d.prototype.manhattanLength = function () {
447
+ return Math.abs(this.x) + Math.abs(this.y);
448
+ };
449
+ /**
450
+ * Converts this vector to a unit vector - that is, sets it equal to a vector with the same
451
+ * direction as this one, but length 1.
452
+ * @returns Return this vector
453
+ */
454
+ AcGeVector2d.prototype.normalize = function () {
455
+ return this.divideScalar(this.length() || 1);
456
+ };
457
+ /**
458
+ * Compute the angle in radians of this vector with respect to the positive x-axis.
459
+ * @returns Return the angle in radians of this vector with respect to the positive x-axis.
460
+ */
461
+ AcGeVector2d.prototype.angle = function () {
462
+ // computes the angle in radians with respect to the positive x-axis
463
+ var angle = Math.atan2(-this.y, -this.x) + Math.PI;
464
+ return angle;
465
+ };
466
+ /**
467
+ * Return the angle between this vector and vector v in radians.
468
+ * @param v Input one 2d vector
469
+ * @returns Return the angle between this vector and vector v in radians.
470
+ */
471
+ AcGeVector2d.prototype.angleTo = function (v) {
472
+ var denominator = Math.sqrt(this.lengthSq() * v.lengthSq());
473
+ if (denominator === 0)
474
+ return Math.PI / 2;
475
+ var theta = this.dot(v) / denominator;
476
+ // clamp, to handle numerical problems
477
+ return Math.acos(Math.max(-1, Math.min(1, theta)));
478
+ };
479
+ /**
480
+ * Compute the distance from this vector to v.
481
+ * @param v Input one 2d vector
482
+ * @returns Return the distance from this vector to v.
483
+ */
484
+ AcGeVector2d.prototype.distanceTo = function (v) {
485
+ return Math.sqrt(this.distanceToSquared(v));
486
+ };
487
+ /**
488
+ * Compute the squared distance from this vector to v. If you are just comparing the distance with
489
+ * another distance, you should compare the distance squared instead as it is slightly more efficient
490
+ * to calculate.
491
+ * @param v Input one 2d vector
492
+ * @returns Return the squared distance from this vector to v.
493
+ */
494
+ AcGeVector2d.prototype.distanceToSquared = function (v) {
495
+ var dx = this.x - v.x, dy = this.y - v.y;
496
+ return dx * dx + dy * dy;
497
+ };
498
+ /**
499
+ * Compute the Manhattan distance from this vector to v.
500
+ * @param v Input one 2d vector
501
+ * @returns Return the Manhattan distance from this vector to v.
502
+ */
503
+ AcGeVector2d.prototype.manhattanDistanceTo = function (v) {
504
+ return Math.abs(this.x - v.x) + Math.abs(this.y - v.y);
505
+ };
506
+ /**
507
+ * Sets this vector to a vector with the same direction as this one, but length l.
508
+ * @param len Input one sclar value
509
+ * @returns Return this vector
510
+ */
511
+ AcGeVector2d.prototype.setLength = function (len) {
512
+ return this.normalize().multiplyScalar(len);
513
+ };
514
+ /**
515
+ * Linearly interpolates between this vector and v, where alpha is the percent distance along the
516
+ * line - alpha = 0 will be this vector, and alpha = 1 will be v.
517
+ * @param v Input 2d vector to interpolate towards.
518
+ * @param alpha Input interpolation factor, typically in the closed interval [0, 1].
519
+ * @returns Return this vector
520
+ */
521
+ AcGeVector2d.prototype.lerp = function (v, alpha) {
522
+ this.x += (v.x - this.x) * alpha;
523
+ this.y += (v.y - this.y) * alpha;
524
+ return this;
525
+ };
526
+ /**
527
+ * Sets this vector to be the vector linearly interpolated between v1 and v2 where alpha is the
528
+ * percent distance along the line connecting the two vectors - alpha = 0 will be v1, and
529
+ * alpha = 1 will be v2.
530
+ * @param v1 Input the starting vector.
531
+ * @param v2 Input vector to interpolate towards.
532
+ * @param alpha Input interpolation factor, typically in the closed interval [0, 1].
533
+ * @returns
534
+ */
535
+ AcGeVector2d.prototype.lerpVectors = function (v1, v2, alpha) {
536
+ this.x = v1.x + (v2.x - v1.x) * alpha;
537
+ this.y = v1.y + (v2.y - v1.y) * alpha;
538
+ return this;
539
+ };
540
+ /**
541
+ * Return true if the components of this vector and v are strictly equal; false otherwise.
542
+ * @param v Input one 2d vector to compare
543
+ * @returns Return true if the components of this vector and v are strictly equal; false otherwise.
544
+ */
545
+ AcGeVector2d.prototype.equals = function (v) {
546
+ return v.x === this.x && v.y === this.y;
547
+ };
548
+ /**
549
+ * Set this vector's x value to be array[ offset ] and y value to be array[ offset + 1 ].
550
+ * @param array Input the source array.
551
+ * @param offset Input (optional) offset into the array. Default is 0.
552
+ * @returns Return this vector
553
+ */
554
+ AcGeVector2d.prototype.fromArray = function (array, offset) {
555
+ if (offset === void 0) { offset = 0; }
556
+ this.x = array[offset];
557
+ this.y = array[offset + 1];
558
+ return this;
559
+ };
560
+ /**
561
+ * Return an array [x, y], or copies x and y into the provided array.
562
+ * @param array Input (optional) array to store this vector to. If this is not provided, a new array will be created.
563
+ * @param offset Input (optional) optional offset into the array.
564
+ * @returns Return an array [x, y], or copies x and y into the provided array.
565
+ */
566
+ AcGeVector2d.prototype.toArray = function (array, offset) {
567
+ if (array === void 0) { array = []; }
568
+ if (offset === void 0) { offset = 0; }
569
+ array[offset] = this.x;
570
+ array[offset + 1] = this.y;
571
+ return array;
572
+ };
573
+ // fromBufferAttribute(attribute, index) {
574
+ // this.x = attribute.getX(index)
575
+ // this.y = attribute.getY(index)
576
+ // return this
577
+ // }
578
+ /**
579
+ * Rotate this vector around center by angle radians.
580
+ * @param center Input the point around which to rotate.
581
+ * @param angle Input the angle to rotate, in radians.
582
+ * @returns Return this vector
583
+ */
584
+ AcGeVector2d.prototype.rotateAround = function (center, angle) {
585
+ var c = Math.cos(angle), s = Math.sin(angle);
586
+ var x = this.x - center.x;
587
+ var y = this.y - center.y;
588
+ this.x = x * c - y * s + center.x;
589
+ this.y = x * s + y * c + center.y;
590
+ return this;
591
+ };
592
+ /**
593
+ * Set each component of this vector to a pseudo-random value between 0 and 1, excluding 1.
594
+ * @returns Return this vector
595
+ */
596
+ AcGeVector2d.prototype.random = function () {
597
+ this.x = Math.random();
598
+ this.y = Math.random();
599
+ return this;
600
+ };
601
+ AcGeVector2d.prototype.relativeEps = function (epsilon) {
602
+ if (epsilon === void 0) { epsilon = 1.0e-7; }
603
+ return Math.min(AcGeMathUtil.relativeEps(this.x, epsilon), AcGeMathUtil.relativeEps(this.y, epsilon));
604
+ };
605
+ AcGeVector2d.prototype[Symbol.iterator] = function () {
606
+ return __generator(this, function (_a) {
607
+ switch (_a.label) {
608
+ case 0: return [4 /*yield*/, this.x];
609
+ case 1:
610
+ _a.sent();
611
+ return [4 /*yield*/, this.y];
612
+ case 2:
613
+ _a.sent();
614
+ return [2 /*return*/];
615
+ }
616
+ });
617
+ };
618
+ AcGeVector2d.EMPTY = Object.freeze(new AcGeVector2d(0, 0));
619
+ return AcGeVector2d;
620
+ }());
621
+ export { AcGeVector2d };
622
+ //# sourceMappingURL=AcGeVector2d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcGeVector2d.js","sourceRoot":"","sources":["../../src/math/AcGeVector2d.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAkBnD;;GAEG;AACH;IAgBE;;OAEG;IACH,sBAAY,CAAW,EAAE,CAAW;QAClC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QAEV,IAAM,UAAU,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAA;QAE1D,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;YACrB,OAAM;QACR,CAAC;QAED,IAAI,UAAU,KAAK,CAAC,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;YAC3C,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;YACb,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;YACb,OAAM;QACR,CAAC;QAED,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;YACf,IAAA,KAAW,CAAqB,EAA9B,CAAC,OAAA,EAAE,CAAC,OAA0B,CA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