@ue-too/curve 0.9.4 → 0.10.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 +472 -4
- package/b-curve.d.ts +86 -0
- package/composite-curve.d.ts +16 -0
- package/index.d.ts +96 -0
- package/index.js +2 -1590
- package/index.js.map +6 -6
- package/line.d.ts +29 -0
- package/package.json +2 -2
- package/path.d.ts +4 -0
package/line.d.ts
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
import { Point } from "@ue-too/math";
|
|
2
|
+
/**
|
|
3
|
+
* Line segment class with geometric utilities.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Represents a straight line segment between two points with operations for:
|
|
7
|
+
* - Line-line intersection
|
|
8
|
+
* - Point projection onto line
|
|
9
|
+
* - Point-in-line testing
|
|
10
|
+
* - Linear interpolation (lerp)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const line = new Line({ x: 0, y: 0 }, { x: 100, y: 100 });
|
|
15
|
+
*
|
|
16
|
+
* // Get length
|
|
17
|
+
* console.log('Length:', line.length());
|
|
18
|
+
*
|
|
19
|
+
* // Interpolate at midpoint
|
|
20
|
+
* const mid = line.lerp(0.5); // { x: 50, y: 50 }
|
|
21
|
+
*
|
|
22
|
+
* // Project a point onto the line
|
|
23
|
+
* const result = line.projectPoint({ x: 50, y: 0 });
|
|
24
|
+
* if (result.within) {
|
|
25
|
+
* console.log('Projection:', result.projectionPoint);
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @category Core
|
|
30
|
+
*/
|
|
2
31
|
export declare class Line {
|
|
3
32
|
private startPoint;
|
|
4
33
|
private endPoint;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ue-too/curve",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"ts-node": "^10.9.2"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ue-too/math": "^0.
|
|
28
|
+
"@ue-too/math": "^0.10.0"
|
|
29
29
|
},
|
|
30
30
|
"main": "./index.js",
|
|
31
31
|
"types": "./index.d.ts",
|