plotboilerplate 1.28.1 → 1.30.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.
- package/README.md +8 -0
- package/dist/index.esm.js +527 -53
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/plotboilerplate.browser.min.js +1 -1
- package/dist/plotboilerplate.browser.min.js.map +1 -1
- package/dist/plotboilerplate.js +528 -51
- package/dist/plotboilerplate.min.js +1 -1
- package/package.json +1 -1
- package/src/cjs/Circle.d.ts +86 -3
- package/src/cjs/Circle.js +179 -4
- package/src/cjs/Circle.js.map +1 -1
- package/src/cjs/CubicBezierCurve.d.ts +34 -3
- package/src/cjs/CubicBezierCurve.js +79 -12
- package/src/cjs/CubicBezierCurve.js.map +1 -1
- package/src/cjs/Line.d.ts +46 -1
- package/src/cjs/Line.js +80 -1
- package/src/cjs/Line.js.map +1 -1
- package/src/cjs/Triangle.d.ts +40 -4
- package/src/cjs/Triangle.js +127 -31
- package/src/cjs/Triangle.js.map +1 -1
- package/src/cjs/VertTuple.d.ts +16 -2
- package/src/cjs/VertTuple.js +20 -2
- package/src/cjs/VertTuple.js.map +1 -1
- package/src/cjs/Vertex.d.ts +25 -2
- package/src/cjs/Vertex.js +43 -1
- package/src/cjs/Vertex.js.map +1 -1
- package/src/cjs/utils/algorithms/minimalContainingCircleFromPoints.d.ts +21 -0
- package/src/cjs/utils/algorithms/minimalContainingCircleFromPoints.js +73 -0
- package/src/cjs/utils/algorithms/minimalContainingCircleFromPoints.js.map +1 -0
- package/src/cjs/utils/algorithms/minimalEnclosingCircleFromPoints.d.ts +21 -0
- package/src/cjs/utils/algorithms/minimalEnclosingCircleFromPoints.js +73 -0
- package/src/cjs/utils/algorithms/minimalEnclosingCircleFromPoints.js.map +1 -0
- package/src/cjs/utils/algorithms/pointsMinimalContainingCircle.d.ts +21 -0
- package/src/cjs/utils/algorithms/pointsMinimalContainingCircle.js +73 -0
- package/src/cjs/utils/algorithms/pointsMinimalContainingCircle.js.map +1 -0
- package/src/cjs/utils/algorithms/solveApollonius3.d.ts +69 -0
- package/src/cjs/utils/algorithms/solveApollonius3.js +118 -0
- package/src/cjs/utils/algorithms/solveApollonius3.js.map +1 -0
- package/src/esm/Circle.d.ts +86 -3
- package/src/esm/Circle.js +179 -4
- package/src/esm/Circle.js.map +1 -1
- package/src/esm/CubicBezierCurve.d.ts +34 -3
- package/src/esm/CubicBezierCurve.js +79 -12
- package/src/esm/CubicBezierCurve.js.map +1 -1
- package/src/esm/Line.d.ts +46 -1
- package/src/esm/Line.js +80 -1
- package/src/esm/Line.js.map +1 -1
- package/src/esm/Triangle.d.ts +40 -4
- package/src/esm/Triangle.js +128 -32
- package/src/esm/Triangle.js.map +1 -1
- package/src/esm/VertTuple.d.ts +16 -2
- package/src/esm/VertTuple.js +20 -2
- package/src/esm/VertTuple.js.map +1 -1
- package/src/esm/Vertex.d.ts +25 -2
- package/src/esm/Vertex.js +44 -2
- package/src/esm/Vertex.js.map +1 -1
- package/src/esm/utils/algorithms/minimalContainingCircleFromPoints.d.ts +21 -0
- package/src/esm/utils/algorithms/minimalContainingCircleFromPoints.js +69 -0
- package/src/esm/utils/algorithms/minimalContainingCircleFromPoints.js.map +1 -0
- package/src/esm/utils/algorithms/minimalEnclosingCircleFromPoints.d.ts +21 -0
- package/src/esm/utils/algorithms/minimalEnclosingCircleFromPoints.js +69 -0
- package/src/esm/utils/algorithms/minimalEnclosingCircleFromPoints.js.map +1 -0
- package/src/esm/utils/algorithms/pointsMinimalContainingCircle.d.ts +21 -0
- package/src/esm/utils/algorithms/pointsMinimalContainingCircle.js +69 -0
- package/src/esm/utils/algorithms/pointsMinimalContainingCircle.js.map +1 -0
- package/src/esm/utils/algorithms/solveApollonius3.d.ts +69 -0
- package/src/esm/utils/algorithms/solveApollonius3.js +114 -0
- package/src/esm/utils/algorithms/solveApollonius3.js.map +1 -0
- package/src/index-gl.js +6 -4
- package/src/index.js +25 -17
- package/src/ts/Circle.ts +200 -5
- package/src/ts/CubicBezierCurve.ts +133 -48
- package/src/ts/Line.ts +84 -1
- package/src/ts/Triangle.ts +148 -41
- package/src/ts/VertTuple.ts +29 -2
- package/src/ts/Vertex.ts +44 -2
- package/src/ts/utils/algorithms/minimalEnclosingCircleFromPoints.ts +69 -0
- package/src/ts/utils/algorithms/solveApollonius3.ts +132 -0
package/package.json
CHANGED
package/src/cjs/Circle.d.ts
CHANGED
|
@@ -14,7 +14,16 @@
|
|
|
14
14
|
* @modified 2022-08-23 Added the `closestPoint` function.
|
|
15
15
|
* @modified 2025-04-09 Added the `Circle.move(amount: XYCoords)` method.
|
|
16
16
|
* @modified 2025-04-16 Class `Circle` now implements interface `Intersectable`.
|
|
17
|
-
* @
|
|
17
|
+
* @modified 2026-06-10 Adding the utility function `Circle.circleUtils.containsPoint`.
|
|
18
|
+
* @modified 2026-06-10 Adding the `Circle.clone` method.
|
|
19
|
+
* @modified 2026-01-13 Adding helper function `Circle.circleUtils.containsPoint` and refactored the member method `containsPoint`.
|
|
20
|
+
* @modified 2026-07-03 Adding the optional `epsilon` parameter to the `Circle.containsCircle` method.
|
|
21
|
+
* @modified 2026-07-03 Fixing the `Circle.clone` method; the center had not been cloned at all, this was fixed.
|
|
22
|
+
* @modified 2026-07-08 Adding the `Circle.setRadius` method (for chaining).
|
|
23
|
+
* @mofified 2026-07-31 Adding the `radicalAxis(Circle)` method. Added the `Circle.circleUtils.createRadicalAxisHelperCircle` and `.circleDistance` helper methods.
|
|
24
|
+
* @modified 2026-08-03 Adding `Circle.tangentsFromPoint`.
|
|
25
|
+
* @modified 2026-08-16 Adding the `Circle.sectorAngleByArcLength` method and the `Circle.circleUtils.sectorAngleByArcLength` helper method.
|
|
26
|
+
* @version 1.8.0
|
|
18
27
|
**/
|
|
19
28
|
import { Bounds } from "./Bounds";
|
|
20
29
|
import { Line } from "./Line";
|
|
@@ -22,6 +31,11 @@ import { Vector } from "./Vector";
|
|
|
22
31
|
import { VertTuple } from "./VertTuple";
|
|
23
32
|
import { Vertex } from "./Vertex";
|
|
24
33
|
import { IBounded, Intersectable, SVGSerializable, UID, XYCoords } from "./interfaces";
|
|
34
|
+
export interface ICircle {
|
|
35
|
+
center: XYCoords;
|
|
36
|
+
radius: number;
|
|
37
|
+
radius_squared?: number;
|
|
38
|
+
}
|
|
25
39
|
/**
|
|
26
40
|
* @classdesc A simple circle: center point and radius.
|
|
27
41
|
*
|
|
@@ -33,7 +47,7 @@ import { IBounded, Intersectable, SVGSerializable, UID, XYCoords } from "./inter
|
|
|
33
47
|
* @requires UID
|
|
34
48
|
* @requires UIDGenerator
|
|
35
49
|
**/
|
|
36
|
-
export declare class Circle implements IBounded, Intersectable, SVGSerializable {
|
|
50
|
+
export declare class Circle implements IBounded, ICircle, Intersectable, SVGSerializable {
|
|
37
51
|
/**
|
|
38
52
|
* Required to generate proper CSS classes and other class related IDs.
|
|
39
53
|
**/
|
|
@@ -75,6 +89,17 @@ export declare class Circle implements IBounded, Intersectable, SVGSerializable
|
|
|
75
89
|
* @param {number} radius - The radius of the circle.
|
|
76
90
|
*/
|
|
77
91
|
constructor(center: Vertex, radius: number);
|
|
92
|
+
/**
|
|
93
|
+
* Set the radius of this circle.
|
|
94
|
+
* The method is meant for chaining, you may also alter the `radius` attribute directly.
|
|
95
|
+
*
|
|
96
|
+
* @method setRadius
|
|
97
|
+
* @param {number} radius - The amount to move.
|
|
98
|
+
* @instance
|
|
99
|
+
* @memberof Circle
|
|
100
|
+
* @return {Circle} this for chaining
|
|
101
|
+
**/
|
|
102
|
+
setRadius(radius: number): Circle;
|
|
78
103
|
/**
|
|
79
104
|
* Move the circle by the given amount.
|
|
80
105
|
*
|
|
@@ -104,7 +129,7 @@ export declare class Circle implements IBounded, Intersectable, SVGSerializable
|
|
|
104
129
|
* @memberof Circle
|
|
105
130
|
* @return {boolean} `true` if any only if the given circle is completely inside this circle.
|
|
106
131
|
*/
|
|
107
|
-
containsCircle(circle: Circle): boolean;
|
|
132
|
+
containsCircle(circle: Circle, epsilon?: number): boolean;
|
|
108
133
|
/**
|
|
109
134
|
* Calculate the distance from this circle to the given line.
|
|
110
135
|
*
|
|
@@ -192,6 +217,20 @@ export declare class Circle implements IBounded, Intersectable, SVGSerializable
|
|
|
192
217
|
* @returns
|
|
193
218
|
*/
|
|
194
219
|
lineIntersectionTangents(line: VertTuple<any>, inVectorBoundsOnly?: boolean): Array<Vector>;
|
|
220
|
+
/**
|
|
221
|
+
* Calculate the radical axis of this and a different circle.
|
|
222
|
+
* The two circles must not be co-centric.
|
|
223
|
+
*
|
|
224
|
+
* See this article for details:
|
|
225
|
+
* https://www.cut-the-knot.org/Curriculum/Geometry/GeoGebra/RadicalAxes.shtml
|
|
226
|
+
*
|
|
227
|
+
* @method radicalAxis
|
|
228
|
+
* @instance
|
|
229
|
+
* @memberof Circle
|
|
230
|
+
* @param {Circle} circleB - The second circle to calculated the radical axis for.
|
|
231
|
+
* @return {Line} A line defining the radical axis of the two circles.
|
|
232
|
+
**/
|
|
233
|
+
radicalAxis(circleB: Circle): Line;
|
|
195
234
|
/**
|
|
196
235
|
* Calculate the closest point on the outline of this circle to the given point.
|
|
197
236
|
*
|
|
@@ -202,6 +241,34 @@ export declare class Circle implements IBounded, Intersectable, SVGSerializable
|
|
|
202
241
|
* @return {Vertex} The closest point on this circle.
|
|
203
242
|
**/
|
|
204
243
|
closestPoint(vert: XYCoords): Vertex;
|
|
244
|
+
/**
|
|
245
|
+
* Get the two tangent vectors for the given point.
|
|
246
|
+
* If the point is on or in the circle then null is returned.
|
|
247
|
+
*
|
|
248
|
+
* @method tangentsFromPoint
|
|
249
|
+
* @instance
|
|
250
|
+
* @memberof Circle
|
|
251
|
+
* @param {Vertex} vert - The point to find the two tangents for.
|
|
252
|
+
* @return {[Vector,Vector]} The two tangent vector
|
|
253
|
+
**/
|
|
254
|
+
tangentsFromPoint(vert: Vertex): [Vector, Vector];
|
|
255
|
+
/**
|
|
256
|
+
* Calculate inner sector angle for this circle and a given circle arc length.
|
|
257
|
+
*
|
|
258
|
+
* @param {number} sectorArcLength - The desired arc length (in units).
|
|
259
|
+
* @returns The sector's inner angle (in radians).
|
|
260
|
+
*/
|
|
261
|
+
sectorAngleByArcLength(sectorArcLength: number): number;
|
|
262
|
+
/**
|
|
263
|
+
* Create a deep copy of this circle.
|
|
264
|
+
*
|
|
265
|
+
* @method clone
|
|
266
|
+
* @return {Circle} A new circle, an exact copy of this one.
|
|
267
|
+
* @instance
|
|
268
|
+
* @memberof Circle
|
|
269
|
+
**/
|
|
270
|
+
clone(): Circle;
|
|
271
|
+
static fromICircle(obj: ICircle): Circle;
|
|
205
272
|
/**
|
|
206
273
|
* This function should invalidate any installed listeners and invalidate this object.
|
|
207
274
|
* After calling this function the object might not hold valid data any more and
|
|
@@ -210,5 +277,21 @@ export declare class Circle implements IBounded, Intersectable, SVGSerializable
|
|
|
210
277
|
destroy(): void;
|
|
211
278
|
static circleUtils: {
|
|
212
279
|
vertAt: (angle: number, radius: number) => Vertex;
|
|
280
|
+
containsPoint: (circleCenter: XYCoords, circleRadius: number, point: XYCoords) => boolean;
|
|
281
|
+
createRadicalAxisHelperCircle: (circleA: Circle, circleB: Circle) => Circle;
|
|
282
|
+
/**
|
|
283
|
+
* Calculate the outer distance between two circles. If the circles touch then the
|
|
284
|
+
* distance is 0.0.
|
|
285
|
+
* If the circles intersect then the distance in negative.
|
|
286
|
+
*/
|
|
287
|
+
circleDistance: (circleA: Circle, circleB: Circle) => number;
|
|
288
|
+
/**
|
|
289
|
+
* Calculate the inner sector angle for a given circle arc length and radius.
|
|
290
|
+
*
|
|
291
|
+
* @param {number} sectorArcLength - The desired arc length.
|
|
292
|
+
* @param {number} circleRadius - The circle's radius.
|
|
293
|
+
* @returns The sector angle in radians.
|
|
294
|
+
*/
|
|
295
|
+
sectorAngleByArcLength: (sectorArcLength: number, circleRadius: number) => number;
|
|
213
296
|
};
|
|
214
297
|
}
|
package/src/cjs/Circle.js
CHANGED
|
@@ -15,7 +15,16 @@
|
|
|
15
15
|
* @modified 2022-08-23 Added the `closestPoint` function.
|
|
16
16
|
* @modified 2025-04-09 Added the `Circle.move(amount: XYCoords)` method.
|
|
17
17
|
* @modified 2025-04-16 Class `Circle` now implements interface `Intersectable`.
|
|
18
|
-
* @
|
|
18
|
+
* @modified 2026-06-10 Adding the utility function `Circle.circleUtils.containsPoint`.
|
|
19
|
+
* @modified 2026-06-10 Adding the `Circle.clone` method.
|
|
20
|
+
* @modified 2026-01-13 Adding helper function `Circle.circleUtils.containsPoint` and refactored the member method `containsPoint`.
|
|
21
|
+
* @modified 2026-07-03 Adding the optional `epsilon` parameter to the `Circle.containsCircle` method.
|
|
22
|
+
* @modified 2026-07-03 Fixing the `Circle.clone` method; the center had not been cloned at all, this was fixed.
|
|
23
|
+
* @modified 2026-07-08 Adding the `Circle.setRadius` method (for chaining).
|
|
24
|
+
* @mofified 2026-07-31 Adding the `radicalAxis(Circle)` method. Added the `Circle.circleUtils.createRadicalAxisHelperCircle` and `.circleDistance` helper methods.
|
|
25
|
+
* @modified 2026-08-03 Adding `Circle.tangentsFromPoint`.
|
|
26
|
+
* @modified 2026-08-16 Adding the `Circle.sectorAngleByArcLength` method and the `Circle.circleUtils.sectorAngleByArcLength` helper method.
|
|
27
|
+
* @version 1.8.0
|
|
19
28
|
**/
|
|
20
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
30
|
exports.Circle = void 0;
|
|
@@ -24,6 +33,7 @@ var Line_1 = require("./Line");
|
|
|
24
33
|
var UIDGenerator_1 = require("./UIDGenerator");
|
|
25
34
|
var Vector_1 = require("./Vector");
|
|
26
35
|
var Vertex_1 = require("./Vertex");
|
|
36
|
+
var geomutils_1 = require("./geomutils");
|
|
27
37
|
/**
|
|
28
38
|
* @classdesc A simple circle: center point and radius.
|
|
29
39
|
*
|
|
@@ -53,6 +63,20 @@ var Circle = /** @class */ (function () {
|
|
|
53
63
|
this.center = center;
|
|
54
64
|
this.radius = radius;
|
|
55
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Set the radius of this circle.
|
|
68
|
+
* The method is meant for chaining, you may also alter the `radius` attribute directly.
|
|
69
|
+
*
|
|
70
|
+
* @method setRadius
|
|
71
|
+
* @param {number} radius - The amount to move.
|
|
72
|
+
* @instance
|
|
73
|
+
* @memberof Circle
|
|
74
|
+
* @return {Circle} this for chaining
|
|
75
|
+
**/
|
|
76
|
+
Circle.prototype.setRadius = function (radius) {
|
|
77
|
+
this.radius = radius;
|
|
78
|
+
return this;
|
|
79
|
+
};
|
|
56
80
|
/**
|
|
57
81
|
* Move the circle by the given amount.
|
|
58
82
|
*
|
|
@@ -76,7 +100,8 @@ var Circle = /** @class */ (function () {
|
|
|
76
100
|
* @return {boolean} `true` if the given point is inside this circle.
|
|
77
101
|
*/
|
|
78
102
|
Circle.prototype.containsPoint = function (point) {
|
|
79
|
-
return this.center.distance(point) < this.radius
|
|
103
|
+
// return this.center.distance(point) < this.radius;//
|
|
104
|
+
return Circle.circleUtils.containsPoint(this.center, this.radius, point);
|
|
80
105
|
};
|
|
81
106
|
/**
|
|
82
107
|
* Check if the given circle is fully contained inside this circle.
|
|
@@ -87,8 +112,13 @@ var Circle = /** @class */ (function () {
|
|
|
87
112
|
* @memberof Circle
|
|
88
113
|
* @return {boolean} `true` if any only if the given circle is completely inside this circle.
|
|
89
114
|
*/
|
|
90
|
-
Circle.prototype.containsCircle = function (circle) {
|
|
91
|
-
|
|
115
|
+
Circle.prototype.containsCircle = function (circle, epsilon) {
|
|
116
|
+
if (typeof epsilon === "undefined" || Number.isNaN(epsilon)) {
|
|
117
|
+
return this.center.distance(circle.center) + circle.radius < this.radius;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
return this.center.distance(circle.center) + circle.radius < this.radius + Math.abs(epsilon);
|
|
121
|
+
}
|
|
92
122
|
};
|
|
93
123
|
/**
|
|
94
124
|
* Calculate the distance from this circle to the given line.
|
|
@@ -294,6 +324,40 @@ var Circle = /** @class */ (function () {
|
|
|
294
324
|
});
|
|
295
325
|
};
|
|
296
326
|
//--- END --- Implement interface `Intersectable`
|
|
327
|
+
/**
|
|
328
|
+
* Calculate the radical axis of this and a different circle.
|
|
329
|
+
* The two circles must not be co-centric.
|
|
330
|
+
*
|
|
331
|
+
* See this article for details:
|
|
332
|
+
* https://www.cut-the-knot.org/Curriculum/Geometry/GeoGebra/RadicalAxes.shtml
|
|
333
|
+
*
|
|
334
|
+
* @method radicalAxis
|
|
335
|
+
* @instance
|
|
336
|
+
* @memberof Circle
|
|
337
|
+
* @param {Circle} circleB - The second circle to calculated the radical axis for.
|
|
338
|
+
* @return {Line} A line defining the radical axis of the two circles.
|
|
339
|
+
**/
|
|
340
|
+
Circle.prototype.radicalAxis = function (circleB) {
|
|
341
|
+
var helperCircle = Circle.circleUtils.createRadicalAxisHelperCircle(this, circleB);
|
|
342
|
+
var intersectionLineA = this.circleIntersection(helperCircle);
|
|
343
|
+
var intersectionLineB = circleB.circleIntersection(helperCircle);
|
|
344
|
+
var intersection = this.circleIntersection(circleB);
|
|
345
|
+
if (!intersectionLineA || !intersectionLineB) {
|
|
346
|
+
console.error("Critical error: none of the two intersections must be null.");
|
|
347
|
+
return intersection; // Fallback
|
|
348
|
+
}
|
|
349
|
+
var lineA = new Line_1.Line(intersectionLineA.a, intersectionLineA.b);
|
|
350
|
+
var lineB = new Line_1.Line(intersectionLineB.a, intersectionLineB.b);
|
|
351
|
+
var firstRadicalAxisPoint = lineA.intersection(lineB);
|
|
352
|
+
var centerConnectLine = new Line_1.Line(this.center, circleB.center);
|
|
353
|
+
var secondRadicalAxisPoint = centerConnectLine.getClosestPoint(firstRadicalAxisPoint);
|
|
354
|
+
// Create a mirrored version of the second radical axis point so both are located
|
|
355
|
+
// symmetrical from the circle connect point.
|
|
356
|
+
// (currently the second point is located ON the connect line)
|
|
357
|
+
var secondRadicalAxisPoint_mirrored = secondRadicalAxisPoint.clone().scale(2.0, firstRadicalAxisPoint);
|
|
358
|
+
var radicalAxis = new Line_1.Line(firstRadicalAxisPoint, secondRadicalAxisPoint_mirrored);
|
|
359
|
+
return intersection && intersection.length() > radicalAxis.length() ? intersection : radicalAxis;
|
|
360
|
+
};
|
|
297
361
|
/**
|
|
298
362
|
* Calculate the closest point on the outline of this circle to the given point.
|
|
299
363
|
*
|
|
@@ -317,6 +381,80 @@ var Circle = /** @class */ (function () {
|
|
|
317
381
|
return lineIntersection.b;
|
|
318
382
|
}
|
|
319
383
|
};
|
|
384
|
+
/**
|
|
385
|
+
* Get the two tangent vectors for the given point.
|
|
386
|
+
* If the point is on or in the circle then null is returned.
|
|
387
|
+
*
|
|
388
|
+
* @method tangentsFromPoint
|
|
389
|
+
* @instance
|
|
390
|
+
* @memberof Circle
|
|
391
|
+
* @param {Vertex} vert - The point to find the two tangents for.
|
|
392
|
+
* @return {[Vector,Vector]} The two tangent vector
|
|
393
|
+
**/
|
|
394
|
+
Circle.prototype.tangentsFromPoint = function (vert) {
|
|
395
|
+
// Inspired by
|
|
396
|
+
// https://www.omnicalculator.com/math/tangent-circle
|
|
397
|
+
var centerDistance = this.center.distance(vert);
|
|
398
|
+
var tangentLength = Math.sqrt(centerDistance * centerDistance - this.radius * this.radius);
|
|
399
|
+
// console.log("this.radius ", this.radius, "centerDistance", centerDistance, "tangentLength", tangentLength);
|
|
400
|
+
if (Number.isNaN(tangentLength)) {
|
|
401
|
+
// vertex is inside circle
|
|
402
|
+
console.log("tangentLength is NaN", tangentLength);
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
var helperCircle = new Circle(vert, tangentLength);
|
|
406
|
+
var intersection = this.circleIntersection(helperCircle);
|
|
407
|
+
if (!intersection) {
|
|
408
|
+
// No intersection (vertex is inside circle)
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
411
|
+
return [new Vector_1.Vector(intersection.a, vert), new Vector_1.Vector(intersection.b, vert)];
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Calculate inner sector angle for this circle and a given circle arc length.
|
|
415
|
+
*
|
|
416
|
+
* @param {number} sectorArcLength - The desired arc length (in units).
|
|
417
|
+
* @returns The sector's inner angle (in radians).
|
|
418
|
+
*/
|
|
419
|
+
Circle.prototype.sectorAngleByArcLength = function (sectorArcLength) {
|
|
420
|
+
return Circle.circleUtils.sectorAngleByArcLength(sectorArcLength, this.radius);
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* Create a deep copy of this circle.
|
|
424
|
+
*
|
|
425
|
+
* @method clone
|
|
426
|
+
* @return {Circle} A new circle, an exact copy of this one.
|
|
427
|
+
* @instance
|
|
428
|
+
* @memberof Circle
|
|
429
|
+
**/
|
|
430
|
+
Circle.prototype.clone = function () {
|
|
431
|
+
return new Circle(this.center.clone(), this.radius);
|
|
432
|
+
};
|
|
433
|
+
Circle.fromICircle = function (obj) {
|
|
434
|
+
return new Circle(new Vertex_1.Vertex(obj.center), obj.radius);
|
|
435
|
+
};
|
|
436
|
+
// static fromObject(obj: object): Circle {
|
|
437
|
+
// if (!obj) {
|
|
438
|
+
// return null;
|
|
439
|
+
// }
|
|
440
|
+
// if (typeof obj !== "object") {
|
|
441
|
+
// return null;
|
|
442
|
+
// }
|
|
443
|
+
// if (!obj.hasOwnProperty("center") || typeof (obj as any).center != "object") {
|
|
444
|
+
// return null;
|
|
445
|
+
// }
|
|
446
|
+
// if (!obj.hasOwnProperty("radius") || typeof !(obj as any).radius != "number") {
|
|
447
|
+
// return null;
|
|
448
|
+
// }
|
|
449
|
+
// var center = (obj as any).center;
|
|
450
|
+
// if (!center.hasOwnProperty("x") || typeof (center as any).x != "number") {
|
|
451
|
+
// return null;
|
|
452
|
+
// }
|
|
453
|
+
// if (!center.hasOwnProperty("y") || typeof (center as any).y != "number") {
|
|
454
|
+
// return null;
|
|
455
|
+
// }
|
|
456
|
+
// return new Circle(new Vertex(center), (obj as any).radius);
|
|
457
|
+
// }
|
|
320
458
|
/**
|
|
321
459
|
* This function should invalidate any installed listeners and invalidate this object.
|
|
322
460
|
* After calling this function the object might not hold valid data any more and
|
|
@@ -331,6 +469,43 @@ var Circle = /** @class */ (function () {
|
|
|
331
469
|
/* return new Vertex( Math.sin(angle) * radius,
|
|
332
470
|
Math.cos(angle) * radius ); */
|
|
333
471
|
return new Vertex_1.Vertex(Math.cos(angle) * radius, Math.sin(angle) * radius);
|
|
472
|
+
},
|
|
473
|
+
containsPoint: function (circleCenter, circleRadius, point) {
|
|
474
|
+
// TODO: cleanup
|
|
475
|
+
// return (
|
|
476
|
+
// (circle.center.x - point.x) * (circle.center.x - point.x) + (circle.center.y - point.y) * (circle.center.y - point.y) <=
|
|
477
|
+
// circle.radius * circle.radius
|
|
478
|
+
// );
|
|
479
|
+
return geomutils_1.geomutils.dist4(point.x, point.y, circleCenter.x, circleCenter.y) < circleRadius;
|
|
480
|
+
},
|
|
481
|
+
createRadicalAxisHelperCircle: function (circleA, circleB) {
|
|
482
|
+
// We need to create a helper circle that intersects BOTH other circles,
|
|
483
|
+
// each in TWO points.
|
|
484
|
+
var circleConnectLine = new Vector_1.Vector(circleA.center.clone(), circleB.center);
|
|
485
|
+
circleConnectLine.a.set(circleConnectLine.vertAt(0.5));
|
|
486
|
+
// Get the perpendicular by half the circle distance.
|
|
487
|
+
var bisector = circleConnectLine.perp();
|
|
488
|
+
var bisectorLength = Math.max(circleA.radius, circleB.radius, bisector.length());
|
|
489
|
+
bisector.setLength(bisectorLength);
|
|
490
|
+
return new Circle(bisector.b, bisector.b.distance(circleA.center));
|
|
491
|
+
},
|
|
492
|
+
/**
|
|
493
|
+
* Calculate the outer distance between two circles. If the circles touch then the
|
|
494
|
+
* distance is 0.0.
|
|
495
|
+
* If the circles intersect then the distance in negative.
|
|
496
|
+
*/
|
|
497
|
+
circleDistance: function (circleA, circleB) {
|
|
498
|
+
return circleA.center.distance(circleB.center) - circleA.radius - circleB.radius;
|
|
499
|
+
},
|
|
500
|
+
/**
|
|
501
|
+
* Calculate the inner sector angle for a given circle arc length and radius.
|
|
502
|
+
*
|
|
503
|
+
* @param {number} sectorArcLength - The desired arc length.
|
|
504
|
+
* @param {number} circleRadius - The circle's radius.
|
|
505
|
+
* @returns The sector angle in radians.
|
|
506
|
+
*/
|
|
507
|
+
sectorAngleByArcLength: function (sectorArcLength, circleRadius) {
|
|
508
|
+
return sectorArcLength / circleRadius;
|
|
334
509
|
}
|
|
335
510
|
};
|
|
336
511
|
return Circle;
|
package/src/cjs/Circle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../ts/Circle.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;IAiBI;;;AAEJ,mCAAkC;AAClC,+BAA8B;AAC9B,+CAA8C;AAC9C,mCAAkC;AAElC,mCAAkC;AAGlC;;;;;;;;;;IAUI;AACJ;IAsCE;;;;;;;OAOG;IACH,gBAAY,MAAc,EAAE,MAAc;QA7C1C;;YAEI;QACK,cAAS,GAAW,QAAQ,CAAC;QA2CpC,IAAI,CAAC,GAAG,GAAG,2BAAY,CAAC,IAAI,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;QAQI;IACJ,qBAAI,GAAJ,UAAK,MAAgB;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;OAQG;IACH,8BAAa,GAAb,UAAc,KAAe;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IACnD,CAAC;IAED;;;;;;;;OAQG;IACH,+BAAc,GAAd,UAAe,MAAc;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAA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AAuB,EAAE,YAAoB;YACpE,OAAO,eAAe,GAAG,YAAY,CAAC;QACxC,CAAC;KACF,AA/CiB,CA+ChB;IACJ,aAAC;CAAA,AAlhBD,IAkhBC,CAAC,YAAY;AAlhBD,wBAAM"}
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
* @modified 2025-04-18 Added evaluation method for cubic Bézier curves `CubicBezierCurve.utils.evaluateT`.
|
|
33
33
|
* @modified 2025-04-18 Refactored method `CubicBezierCurve.getPointAt` to use `evaluateT`.
|
|
34
34
|
* @modified 2025-04-18 Fixed the `CubicBezierCurve.getBounds` method: now returning the real bounding box. Before it was an approximated one.
|
|
35
|
-
* @modified 2025
|
|
36
|
-
* @
|
|
35
|
+
* @modified 2025-04-18 Added helper methods for bounding box calculation `CubucBezierCurve.util.cubicPolyMinMax` and `cubicPoly`.
|
|
36
|
+
* @modified 2026-09-09 Adding methods `CubicBezierCurve.trimStartEnd` and `CubicBezierCurve.trimStartEndAt`.
|
|
37
|
+
* @version 2.10.0
|
|
37
38
|
*
|
|
38
39
|
* @file CubicBezierCurve
|
|
39
40
|
* @public
|
|
@@ -401,6 +402,36 @@ export declare class CubicBezierCurve implements IBounded, Intersectable, PathSe
|
|
|
401
402
|
* @returns {CubicBezierCurve} `this` for chanining.
|
|
402
403
|
*/
|
|
403
404
|
trimEndAt(t: number): CubicBezierCurve;
|
|
405
|
+
/**
|
|
406
|
+
* Trim off a start and end section of this curve. The position parameters `uStart` and `uEnd` are the absolute positions in [0..arcLength].
|
|
407
|
+
* The remaining curve will be the one in the bounds `[uStart,uEnd]` (so `[0.0,uStart]` and `[uEnd,1.0]` are cut off).
|
|
408
|
+
*
|
|
409
|
+
* Parameters out of bounds (< 0.0 or > arcLength) are ignored.
|
|
410
|
+
* If `uEnd` is smaller than `uStart` then a curve with length zero (0) at `uStart` is returned.
|
|
411
|
+
*
|
|
412
|
+
* @method trimStartEndAt
|
|
413
|
+
* @instance
|
|
414
|
+
* @memberof CubicBezierCurve
|
|
415
|
+
* @param {number} tStart - The relative position parameter where to cut off the head curve.
|
|
416
|
+
* @param {number} tEnd - The relative position parameter where to cut off the tail curve.
|
|
417
|
+
* @returns {CubicBezierCurve} `this` for chanining.
|
|
418
|
+
*/
|
|
419
|
+
trimStartEnd(uStart: number, uEnd: number): CubicBezierCurve;
|
|
420
|
+
/**
|
|
421
|
+
* Trim off a start and end section of this curve. The position parameters `tStart` and `tEnd` are the relative positions in [0..1].
|
|
422
|
+
* The remaining curve will be the one in the bounds `[tStart,tEnd]` (so `[0.0,tStart]` and `[tEnd,1.0]` are cut off).
|
|
423
|
+
*
|
|
424
|
+
* Parameters out of bounds (< 0.0 or > 1.0) are ignored.
|
|
425
|
+
* If `tEnd` is smaller than `tStart` then a curve with length zero (0) at `tStart` is returned.
|
|
426
|
+
*
|
|
427
|
+
* @method trimStartEndAt
|
|
428
|
+
* @instance
|
|
429
|
+
* @memberof CubicBezierCurve
|
|
430
|
+
* @param {number} tStart - The relative position parameter where to cut off the head curve.
|
|
431
|
+
* @param {number} tEnd - The relative position parameter where to cut off the tail curve.
|
|
432
|
+
* @returns {CubicBezierCurve} `this` for chanining.
|
|
433
|
+
*/
|
|
434
|
+
trimStartEndAt(tStart: number, tEnd: number): CubicBezierCurve;
|
|
404
435
|
/**
|
|
405
436
|
* Get a sub curve at the given start end end positions (values on the curve's length, between 0 and curve.arcLength).
|
|
406
437
|
*
|
|
@@ -612,7 +643,7 @@ export declare class CubicBezierCurve implements IBounded, Intersectable, PathSe
|
|
|
612
643
|
* @param {number} tEnd – The end offset if the desired cub curve (must be in [0..1]).
|
|
613
644
|
* @instance
|
|
614
645
|
* @memberof CubicBezierCurve
|
|
615
|
-
* @return {
|
|
646
|
+
* @return {[Vertex, Vertex, Vertex, Vertex]} The sub curve as curve vertices.
|
|
616
647
|
**/
|
|
617
648
|
getSubCurvePointsAt: (curve: CubicBezierCurve, tStart: number, tEnd: number) => [Vertex, Vertex, Vertex, Vertex];
|
|
618
649
|
/**
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
* @modified 2025-04-18 Added evaluation method for cubic Bézier curves `CubicBezierCurve.utils.evaluateT`.
|
|
34
34
|
* @modified 2025-04-18 Refactored method `CubicBezierCurve.getPointAt` to use `evaluateT`.
|
|
35
35
|
* @modified 2025-04-18 Fixed the `CubicBezierCurve.getBounds` method: now returning the real bounding box. Before it was an approximated one.
|
|
36
|
-
* @modified 2025
|
|
37
|
-
* @
|
|
36
|
+
* @modified 2025-04-18 Added helper methods for bounding box calculation `CubucBezierCurve.util.cubicPolyMinMax` and `cubicPoly`.
|
|
37
|
+
* @modified 2026-09-09 Adding methods `CubicBezierCurve.trimStartEnd` and `CubicBezierCurve.trimStartEndAt`.
|
|
38
|
+
* @version 2.10.0
|
|
38
39
|
*
|
|
39
40
|
* @file CubicBezierCurve
|
|
40
41
|
* @public
|
|
@@ -489,6 +490,7 @@ var CubicBezierCurve = /** @class */ (function () {
|
|
|
489
490
|
this.endControlPoint.set(subCurbePoints[3]);
|
|
490
491
|
this.updateArcLengths();
|
|
491
492
|
return this;
|
|
493
|
+
// return this.trimStartEndAt(t, null);
|
|
492
494
|
};
|
|
493
495
|
/**
|
|
494
496
|
* Trim off the end of this curve. The position parameter `uValue` is the absolute position on the
|
|
@@ -524,7 +526,79 @@ var CubicBezierCurve = /** @class */ (function () {
|
|
|
524
526
|
this.endControlPoint.set(subCurbePoints[3]);
|
|
525
527
|
this.updateArcLengths();
|
|
526
528
|
return this;
|
|
529
|
+
// return this.trimStartEndAt(null, t);
|
|
527
530
|
};
|
|
531
|
+
/**
|
|
532
|
+
* Trim off a start and end section of this curve. The position parameters `uStart` and `uEnd` are the absolute positions in [0..arcLength].
|
|
533
|
+
* The remaining curve will be the one in the bounds `[uStart,uEnd]` (so `[0.0,uStart]` and `[uEnd,1.0]` are cut off).
|
|
534
|
+
*
|
|
535
|
+
* Parameters out of bounds (< 0.0 or > arcLength) are ignored.
|
|
536
|
+
* If `uEnd` is smaller than `uStart` then a curve with length zero (0) at `uStart` is returned.
|
|
537
|
+
*
|
|
538
|
+
* @method trimStartEndAt
|
|
539
|
+
* @instance
|
|
540
|
+
* @memberof CubicBezierCurve
|
|
541
|
+
* @param {number} tStart - The relative position parameter where to cut off the head curve.
|
|
542
|
+
* @param {number} tEnd - The relative position parameter where to cut off the tail curve.
|
|
543
|
+
* @returns {CubicBezierCurve} `this` for chanining.
|
|
544
|
+
*/
|
|
545
|
+
CubicBezierCurve.prototype.trimStartEnd = function (uStart, uEnd) {
|
|
546
|
+
return this.trimStartEndAt(this.convertU2T(uStart), this.convertU2T(uEnd));
|
|
547
|
+
};
|
|
548
|
+
/**
|
|
549
|
+
* Trim off a start and end section of this curve. The position parameters `tStart` and `tEnd` are the relative positions in [0..1].
|
|
550
|
+
* The remaining curve will be the one in the bounds `[tStart,tEnd]` (so `[0.0,tStart]` and `[tEnd,1.0]` are cut off).
|
|
551
|
+
*
|
|
552
|
+
* Parameters out of bounds (< 0.0 or > 1.0) are ignored.
|
|
553
|
+
* If `tEnd` is smaller than `tStart` then a curve with length zero (0) at `tStart` is returned.
|
|
554
|
+
*
|
|
555
|
+
* @method trimStartEndAt
|
|
556
|
+
* @instance
|
|
557
|
+
* @memberof CubicBezierCurve
|
|
558
|
+
* @param {number} tStart - The relative position parameter where to cut off the head curve.
|
|
559
|
+
* @param {number} tEnd - The relative position parameter where to cut off the tail curve.
|
|
560
|
+
* @returns {CubicBezierCurve} `this` for chanining.
|
|
561
|
+
*/
|
|
562
|
+
CubicBezierCurve.prototype.trimStartEndAt = function (tStart, tEnd) {
|
|
563
|
+
var cleanTrimStart = Math.min(Math.max(0.0, tStart), 1.0);
|
|
564
|
+
var cleanTrimEnd = Math.min(Math.max(cleanTrimStart, tEnd), 1.0);
|
|
565
|
+
this.trimStartAt(cleanTrimStart);
|
|
566
|
+
var relativeTrimEnd = (cleanTrimEnd - cleanTrimStart) / (1.0 - cleanTrimStart);
|
|
567
|
+
this.trimEndAt(relativeTrimEnd);
|
|
568
|
+
return this;
|
|
569
|
+
};
|
|
570
|
+
// __trimStartEndAt(tStart: number, tEnd: number): CubicBezierCurve {
|
|
571
|
+
// var finalCurvePoints = [
|
|
572
|
+
// this.startPoint.clone(),
|
|
573
|
+
// this.endPoint.clone(),
|
|
574
|
+
// this.startControlPoint.clone(),
|
|
575
|
+
// this.endControlPoint.clone()
|
|
576
|
+
// ];
|
|
577
|
+
// if (typeof tStart === "number" && !Number.isNaN(tStart)) {
|
|
578
|
+
// const subCurvePointsStart = CubicBezierCurve.utils.getSubCurvePointsAt(this, tStart, 1.0);
|
|
579
|
+
// finalCurvePoints[0].set(subCurvePointsStart[0]);
|
|
580
|
+
// finalCurvePoints[2].set(subCurvePointsStart[2]);
|
|
581
|
+
// // this.startPoint.set(subCurvePointsStart[0]);
|
|
582
|
+
// // this.startControlPoint.set(subCurvePointsStart[2]);
|
|
583
|
+
// // this.endPoint.set(subCurvePointsStart[1]);
|
|
584
|
+
// // this.endControlPoint.set(subCurvePointsStart[3]);
|
|
585
|
+
// }
|
|
586
|
+
// if (typeof tEnd === "number" && !Number.isNaN(tEnd)) {
|
|
587
|
+
// const subCurvePointsEnd = CubicBezierCurve.utils.getSubCurvePointsAt(this, 0.0, tEnd);
|
|
588
|
+
// // this.startPoint.set(subCurvePointsEnd[0]);
|
|
589
|
+
// // this.startControlPoint.set(subCurvePointsEnd[2]);
|
|
590
|
+
// // this.endPoint.set(subCurvePointsEnd[1]);
|
|
591
|
+
// // this.endControlPoint.set(subCurvePointsEnd[3]);
|
|
592
|
+
// finalCurvePoints[1].set(subCurvePointsEnd[1]);
|
|
593
|
+
// finalCurvePoints[3].set(subCurvePointsEnd[3]);
|
|
594
|
+
// }
|
|
595
|
+
// this.startPoint.set(finalCurvePoints[0]);
|
|
596
|
+
// this.endPoint.set(finalCurvePoints[1]);
|
|
597
|
+
// this.startControlPoint.set(finalCurvePoints[2]);
|
|
598
|
+
// this.endControlPoint.set(finalCurvePoints[3]);
|
|
599
|
+
// this.updateArcLengths();
|
|
600
|
+
// return this;
|
|
601
|
+
// }
|
|
528
602
|
/**
|
|
529
603
|
* Get a sub curve at the given start end end positions (values on the curve's length, between 0 and curve.arcLength).
|
|
530
604
|
*
|
|
@@ -879,10 +953,7 @@ var CubicBezierCurve = /** @class */ (function () {
|
|
|
879
953
|
*/
|
|
880
954
|
CubicBezierCurve.utils = {
|
|
881
955
|
evaluateT: function (p0, p1, p2, p3, t) {
|
|
882
|
-
return p0 * Math.pow(1.0 - t, 3) +
|
|
883
|
-
p1 * 3 * t * Math.pow(1.0 - t, 2) +
|
|
884
|
-
p2 * 3 * Math.pow(t, 2) * (1.0 - t) +
|
|
885
|
-
p3 * Math.pow(t, 3);
|
|
956
|
+
return (p0 * Math.pow(1.0 - t, 3) + p1 * 3 * t * Math.pow(1.0 - t, 2) + p2 * 3 * Math.pow(t, 2) * (1.0 - t) + p3 * Math.pow(t, 3));
|
|
886
957
|
},
|
|
887
958
|
cubicPolyMinMax: function (p0, p1, p2, p3) {
|
|
888
959
|
// var polyX = CubicBezierCurve.utils.cubicPoly2(
|
|
@@ -954,7 +1025,7 @@ var CubicBezierCurve = /** @class */ (function () {
|
|
|
954
1025
|
* @param {number} tEnd – The end offset if the desired cub curve (must be in [0..1]).
|
|
955
1026
|
* @instance
|
|
956
1027
|
* @memberof CubicBezierCurve
|
|
957
|
-
* @return {
|
|
1028
|
+
* @return {[Vertex, Vertex, Vertex, Vertex]} The sub curve as curve vertices.
|
|
958
1029
|
**/
|
|
959
1030
|
getSubCurvePointsAt: function (curve, tStart, tEnd) {
|
|
960
1031
|
var startVec = new Vector_1.Vector(curve.getPointAt(tStart), curve.getTangentAt(tStart));
|
|
@@ -1043,11 +1114,7 @@ var CubicBezierCurve = /** @class */ (function () {
|
|
|
1043
1114
|
* @returns {[number,number,number]}
|
|
1044
1115
|
*/
|
|
1045
1116
|
cubicPoly: function (p0, p1, p2, p3) {
|
|
1046
|
-
return [
|
|
1047
|
-
3 * p3 - 9 * p2 + 9 * p1 - 3 * p0,
|
|
1048
|
-
6 * p0 - 12 * p1 + 6 * p2,
|
|
1049
|
-
3 * p1 - 3 * p0
|
|
1050
|
-
];
|
|
1117
|
+
return [3 * p3 - 9 * p2 + 9 * p1 - 3 * p0, 6 * p0 - 12 * p1 + 6 * p2, 3 * p1 - 3 * p0];
|
|
1051
1118
|
},
|
|
1052
1119
|
/**
|
|
1053
1120
|
* sign of number, but is division safe: no zero returned :)
|