toosoon-utils 4.0.4 → 4.0.5

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 (2) hide show
  1. package/README.md +82 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -452,7 +452,33 @@ cubicBezier(
452
452
  ): [number, number];
453
453
  ```
454
454
 
455
- ##### quadraticBesier(t, x1, y1, cpx, cpy, x2, y2)
455
+ ##### computeCubicBezierCurvature(x1, y1, cpx, cpy, x2, y2)
456
+
457
+ Compute the curvature of a Cubic Bézier curve.
458
+
459
+ - `x1`: X-axis coordinate of the start point.
460
+ - `y1`: Y-axis coordinate of the start point.
461
+ - `cpx1`: X-axis coordinate of the first control point.
462
+ - `cpy1`: Y-axis coordinate of the first control point.
463
+ - `cpx2`: X-axis coordinate of the second control point.
464
+ - `cpy2`: Y-axis coordinate of the second control point.
465
+ - `x2`: X-axis coordinate of the end point.
466
+ - `y2`: Y-axis coordinate of the end point.
467
+
468
+ ```ts
469
+ computeCubicBezierCurvature(
470
+ x1: number,
471
+ y1: number,
472
+ cpx1: number,
473
+ cpy1: number,
474
+ cpx2: number,
475
+ cpy2: number,
476
+ x2: number,
477
+ y2: number
478
+ ): number;
479
+ ```
480
+
481
+ ##### quadraticBezier(t, x1, y1, cpx, cpy, x2, y2)
456
482
 
457
483
  Interpolate a point on an elliptical arc Quadratic Bézier curve.
458
484
 
@@ -465,7 +491,7 @@ Interpolate a point on an elliptical arc Quadratic Bézier curve.
465
491
  - `y2`: Y-axis coordinate of the end point.
466
492
 
467
493
  ```ts
468
- quadraticBesier(
494
+ quadraticBezier(
469
495
  t: number,
470
496
  x1: number,
471
497
  y1: number,
@@ -476,7 +502,29 @@ quadraticBesier(
476
502
  ): [number, number];
477
503
  ```
478
504
 
479
- ##### arc(t, x1, y1, x2, y2, rx, ry, angle, largeArc, sweep)
505
+ ##### computeQuadraticBezierCurvature(x1, y1, cpx, cpy, x2, y2)
506
+
507
+ Compute the curvature of a Quadratic Bézier curve.
508
+
509
+ - `x1`: X-axis coordinate of the start point.
510
+ - `y1`: Y-axis coordinate of the start point.
511
+ - `cpx`: X-axis coordinate of the control point.
512
+ - `cpy`: Y-axis coordinate of the control point.
513
+ - `x2`: X-axis coordinate of the end point.
514
+ - `y2`: Y-axis coordinate of the end point.
515
+
516
+ ```ts
517
+ computeQuadraticBezierCurvature(
518
+ x1: number,
519
+ y1: number,
520
+ cpx: number,
521
+ cpy: number,
522
+ x2: number,
523
+ y2: number
524
+ ): number;
525
+ ```
526
+
527
+ ##### arc(t, x1, y1, x2, y2, rx, ry, angle, largeArc, clockwise)
480
528
 
481
529
  Interpolate a point on an elliptical arc.
482
530
 
@@ -488,8 +536,8 @@ Interpolate a point on an elliptical arc.
488
536
  - `rx`: X-radius of the ellipse.
489
537
  - `ry`: Y-radius of the ellipse.
490
538
  - `angle`: Rotation angle of the ellipse (in radians).
491
- - `[largeArc=true]`: Flag indicating whether to draw the larger of the two possible arcs.
492
- - `[clockwise=true]`: Flag indicating the direction of the arc.
539
+ - `[largeArc]`: Flag indicating whether to draw the larger of the two possible arcs.
540
+ - `[clockwise]`: Flag indicating the direction of the arc.
493
541
 
494
542
  ```ts
495
543
  arc(
@@ -502,10 +550,38 @@ arc(
502
550
  ry: number,
503
551
  angle: number,
504
552
  largeArc?: boolean,
505
- sweep?: boolean
553
+ clockwise?: boolean
506
554
  ): [number, number];
507
555
  ```
508
556
 
557
+ ##### computeArcCurvature(x1, y1, x2, y2, rx, ry, angle, largeArc, clockwise)
558
+
559
+ Compute the curvature of an elliptical arc.
560
+
561
+ - `x1`: X-axis coordinate of the starting point of the arc.
562
+ - `y1`: Y-axis coordinate of the starting point of the arc.
563
+ - `x2`: X-axis coordinate of the ending point of the arc.
564
+ - `y2`: Y-axis coordinate of the ending point of the arc.
565
+ - `rx`: X-radius of the ellipse.
566
+ - `ry`: Y-radius of the ellipse.
567
+ - `angle`: Rotation angle of the ellipse (in radians).
568
+ - `[largeArc]`: Flag indicating whether to draw the larger of the two possible arcs.
569
+ - `[clockwise]`: Flag indicating the direction of the arc.
570
+
571
+ ```ts
572
+ computeArcCurvature(
573
+ x1: number,
574
+ y1: number,
575
+ x2: number,
576
+ y2: number,
577
+ rx: number,
578
+ ry: number,
579
+ angle: number,
580
+ largeArc?: boolean,
581
+ clockwise?: boolean
582
+ ): number;
583
+ ```
584
+
509
585
  #### Fit
510
586
 
511
587
  <!-- -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toosoon-utils",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "Utility functions & classes",
5
5
  "type": "module",
6
6
  "engines": {