@vertexvis/geometry 0.24.5 → 1.0.0-canary.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/dist/angle.d.ts +35 -35
- package/dist/boundingBox.d.ts +49 -49
- package/dist/boundingSphere.d.ts +14 -14
- package/dist/{bundle.cjs.js → bundle.cjs} +2149 -2149
- package/dist/bundle.cjs.map +1 -0
- package/dist/{bundle.esm.js → bundle.js} +2149 -2149
- package/dist/bundle.js.map +1 -0
- package/dist/cdn/{bundle.esm.js → bundle.js} +2150 -2184
- package/dist/cdn/bundle.js.map +1 -0
- package/dist/cdn/bundle.min.js +2 -0
- package/dist/cdn/bundle.min.js.map +1 -0
- package/dist/dimensions.d.ts +94 -94
- package/dist/euler.d.ts +57 -57
- package/dist/index.d.ts +21 -21
- package/dist/line3.d.ts +48 -48
- package/dist/math.d.ts +20 -20
- package/dist/matrix.d.ts +73 -73
- package/dist/matrix2.d.ts +29 -29
- package/dist/matrix4.d.ts +285 -285
- package/dist/plane.d.ts +51 -51
- package/dist/point.d.ts +80 -80
- package/dist/quaternion.d.ts +65 -65
- package/dist/ray.d.ts +52 -52
- package/dist/rectangle.d.ts +125 -125
- package/dist/vector3.d.ts +226 -226
- package/dist/vector4.d.ts +23 -23
- package/package.json +22 -13
- package/dist/bundle.cjs.js.map +0 -1
- package/dist/bundle.esm.js.map +0 -1
- package/dist/cdn/__tests__/angle.test.d.ts +0 -1
- package/dist/cdn/__tests__/boundingBox.test.d.ts +0 -1
- package/dist/cdn/__tests__/boundingSphere.test.d.ts +0 -1
- package/dist/cdn/__tests__/dimensions.test.d.ts +0 -1
- package/dist/cdn/__tests__/euler.test.d.ts +0 -1
- package/dist/cdn/__tests__/line3.test.d.ts +0 -1
- package/dist/cdn/__tests__/math.spec.d.ts +0 -1
- package/dist/cdn/__tests__/matrix.test.d.ts +0 -1
- package/dist/cdn/__tests__/matrix2.test.d.ts +0 -1
- package/dist/cdn/__tests__/matrix4.test.d.ts +0 -1
- package/dist/cdn/__tests__/plane.test.d.ts +0 -1
- package/dist/cdn/__tests__/point.test.d.ts +0 -1
- package/dist/cdn/__tests__/quaternion.test.d.ts +0 -1
- package/dist/cdn/__tests__/ray.test.d.ts +0 -1
- package/dist/cdn/__tests__/rectangle.test.d.ts +0 -1
- package/dist/cdn/__tests__/vector3.test.d.ts +0 -1
- package/dist/cdn/__tests__/vector4.test.d.ts +0 -1
- package/dist/cdn/angle.d.ts +0 -35
- package/dist/cdn/boundingBox.d.ts +0 -49
- package/dist/cdn/boundingSphere.d.ts +0 -14
- package/dist/cdn/bundle.esm.js.map +0 -1
- package/dist/cdn/bundle.esm.min.js +0 -16
- package/dist/cdn/bundle.esm.min.js.map +0 -1
- package/dist/cdn/dimensions.d.ts +0 -94
- package/dist/cdn/euler.d.ts +0 -57
- package/dist/cdn/index.d.ts +0 -21
- package/dist/cdn/line3.d.ts +0 -48
- package/dist/cdn/math.d.ts +0 -20
- package/dist/cdn/matrix.d.ts +0 -73
- package/dist/cdn/matrix2.d.ts +0 -29
- package/dist/cdn/matrix4.d.ts +0 -285
- package/dist/cdn/plane.d.ts +0 -51
- package/dist/cdn/point.d.ts +0 -80
- package/dist/cdn/quaternion.d.ts +0 -65
- package/dist/cdn/ray.d.ts +0 -52
- package/dist/cdn/rectangle.d.ts +0 -125
- package/dist/cdn/vector3.d.ts +0 -226
- package/dist/cdn/vector4.d.ts +0 -23
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Geometry
|
|
3
|
-
*/
|
|
4
|
-
import * as Angle from './angle';
|
|
5
|
-
import * as BoundingBox from './boundingBox';
|
|
6
|
-
import * as BoundingSphere from './boundingSphere';
|
|
7
|
-
import * as Dimensions from './dimensions';
|
|
8
|
-
import * as Euler from './euler';
|
|
9
|
-
import * as Line3 from './line3';
|
|
10
|
-
import * as Matrix from './matrix';
|
|
11
|
-
import * as Matrix2 from './matrix2';
|
|
12
|
-
import * as Matrix4 from './matrix4';
|
|
13
|
-
import * as Plane from './plane';
|
|
14
|
-
import * as Point from './point';
|
|
15
|
-
import * as Quaternion from './quaternion';
|
|
16
|
-
import * as Ray from './ray';
|
|
17
|
-
import * as Rectangle from './rectangle';
|
|
18
|
-
import * as Vector3 from './vector3';
|
|
19
|
-
import * as Vector4 from './vector4';
|
|
20
|
-
export * from './math';
|
|
21
|
-
export { Angle, BoundingBox, BoundingSphere, Dimensions, Euler, Line3, Matrix, Matrix2, Matrix4, Plane, Point, Quaternion, Ray, Rectangle, Vector3, Vector4, };
|
|
1
|
+
/**
|
|
2
|
+
* @module Geometry
|
|
3
|
+
*/
|
|
4
|
+
import * as Angle from './angle';
|
|
5
|
+
import * as BoundingBox from './boundingBox';
|
|
6
|
+
import * as BoundingSphere from './boundingSphere';
|
|
7
|
+
import * as Dimensions from './dimensions';
|
|
8
|
+
import * as Euler from './euler';
|
|
9
|
+
import * as Line3 from './line3';
|
|
10
|
+
import * as Matrix from './matrix';
|
|
11
|
+
import * as Matrix2 from './matrix2';
|
|
12
|
+
import * as Matrix4 from './matrix4';
|
|
13
|
+
import * as Plane from './plane';
|
|
14
|
+
import * as Point from './point';
|
|
15
|
+
import * as Quaternion from './quaternion';
|
|
16
|
+
import * as Ray from './ray';
|
|
17
|
+
import * as Rectangle from './rectangle';
|
|
18
|
+
import * as Vector3 from './vector3';
|
|
19
|
+
import * as Vector4 from './vector4';
|
|
20
|
+
export * from './math';
|
|
21
|
+
export { Angle, BoundingBox, BoundingSphere, Dimensions, Euler, Line3, Matrix, Matrix2, Matrix4, Plane, Point, Quaternion, Ray, Rectangle, Vector3, Vector4, };
|
package/dist/line3.d.ts
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import * as Matrix4 from './matrix4';
|
|
2
|
-
import * as Vector3 from './vector3';
|
|
3
|
-
/**
|
|
4
|
-
* A `Line3` represents a line segment between a `start` and `end` point.
|
|
5
|
-
*/
|
|
6
|
-
export interface Line3 {
|
|
7
|
-
/**
|
|
8
|
-
* The start of the line segment.
|
|
9
|
-
*/
|
|
10
|
-
start: Vector3.Vector3;
|
|
11
|
-
/**
|
|
12
|
-
* The end of the line segment.
|
|
13
|
-
*/
|
|
14
|
-
end: Vector3.Vector3;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Creates a new `Line3`. If unspecified, the start and end values of the line
|
|
18
|
-
* will be at origin.
|
|
19
|
-
*
|
|
20
|
-
* @param values The values to assign to the line.
|
|
21
|
-
*/
|
|
22
|
-
export declare function create(values?: Partial<Line3>): Line3;
|
|
23
|
-
/**
|
|
24
|
-
* Returns the point that is halfway between start and end.
|
|
25
|
-
*/
|
|
26
|
-
export declare function center(line: Line3): Vector3.Vector3;
|
|
27
|
-
/**
|
|
28
|
-
* Returns a line where the start and end points are transformed with the given
|
|
29
|
-
* matrix.
|
|
30
|
-
*
|
|
31
|
-
* @param line The line to transform.
|
|
32
|
-
* @param matrix The matrix to apply.
|
|
33
|
-
* @returns A transformed line.
|
|
34
|
-
*/
|
|
35
|
-
export declare function transformMatrix(line: Line3, matrix: Matrix4.Matrix4): Line3;
|
|
36
|
-
/**
|
|
37
|
-
* Euclidean distance between the start and end points of the line.
|
|
38
|
-
*/
|
|
39
|
-
export declare function distance(line: Line3): number;
|
|
40
|
-
/**
|
|
41
|
-
* Returns the squared distance between a line's start and end point. If you're
|
|
42
|
-
* just comparing distances, this is slightly more efficient than `distanceTo`.
|
|
43
|
-
*/
|
|
44
|
-
export declare function distanceSquared(line: Line3): number;
|
|
45
|
-
/**
|
|
46
|
-
* Returns a vector describing the direction of the line from start to end.
|
|
47
|
-
*/
|
|
48
|
-
export declare function direction(line: Line3): Vector3.Vector3;
|
|
1
|
+
import * as Matrix4 from './matrix4';
|
|
2
|
+
import * as Vector3 from './vector3';
|
|
3
|
+
/**
|
|
4
|
+
* A `Line3` represents a line segment between a `start` and `end` point.
|
|
5
|
+
*/
|
|
6
|
+
export interface Line3 {
|
|
7
|
+
/**
|
|
8
|
+
* The start of the line segment.
|
|
9
|
+
*/
|
|
10
|
+
start: Vector3.Vector3;
|
|
11
|
+
/**
|
|
12
|
+
* The end of the line segment.
|
|
13
|
+
*/
|
|
14
|
+
end: Vector3.Vector3;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new `Line3`. If unspecified, the start and end values of the line
|
|
18
|
+
* will be at origin.
|
|
19
|
+
*
|
|
20
|
+
* @param values The values to assign to the line.
|
|
21
|
+
*/
|
|
22
|
+
export declare function create(values?: Partial<Line3>): Line3;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the point that is halfway between start and end.
|
|
25
|
+
*/
|
|
26
|
+
export declare function center(line: Line3): Vector3.Vector3;
|
|
27
|
+
/**
|
|
28
|
+
* Returns a line where the start and end points are transformed with the given
|
|
29
|
+
* matrix.
|
|
30
|
+
*
|
|
31
|
+
* @param line The line to transform.
|
|
32
|
+
* @param matrix The matrix to apply.
|
|
33
|
+
* @returns A transformed line.
|
|
34
|
+
*/
|
|
35
|
+
export declare function transformMatrix(line: Line3, matrix: Matrix4.Matrix4): Line3;
|
|
36
|
+
/**
|
|
37
|
+
* Euclidean distance between the start and end points of the line.
|
|
38
|
+
*/
|
|
39
|
+
export declare function distance(line: Line3): number;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the squared distance between a line's start and end point. If you're
|
|
42
|
+
* just comparing distances, this is slightly more efficient than `distanceTo`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function distanceSquared(line: Line3): number;
|
|
45
|
+
/**
|
|
46
|
+
* Returns a vector describing the direction of the line from start to end.
|
|
47
|
+
*/
|
|
48
|
+
export declare function direction(line: Line3): Vector3.Vector3;
|
package/dist/math.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Clamps the given value between `min` and `max`.
|
|
3
|
-
*
|
|
4
|
-
* @param value The value to clamp.
|
|
5
|
-
* @param min The min possible value.
|
|
6
|
-
* @param max The max possible value.
|
|
7
|
-
* @returns `value` or a value clamped to `min` or `max`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function clamp(value: number, min: number, max: number): number;
|
|
10
|
-
/**
|
|
11
|
-
* Linear interpolates a value between `a` and `b` by `t`. If `t` is 0, then the
|
|
12
|
-
* result will be `a`. If `t` is 1, then the result will be `b`. `t` will be
|
|
13
|
-
* clamped to a value between 0 and 1.
|
|
14
|
-
*
|
|
15
|
-
* @param a The start value.
|
|
16
|
-
* @param b The end value.
|
|
17
|
-
* @param t The interpolation value between 0 and 1.
|
|
18
|
-
* @returns The interpolated value between `a` and `b`.
|
|
19
|
-
*/
|
|
20
|
-
export declare function lerp(a: number, b: number, t: number): number;
|
|
1
|
+
/**
|
|
2
|
+
* Clamps the given value between `min` and `max`.
|
|
3
|
+
*
|
|
4
|
+
* @param value The value to clamp.
|
|
5
|
+
* @param min The min possible value.
|
|
6
|
+
* @param max The max possible value.
|
|
7
|
+
* @returns `value` or a value clamped to `min` or `max`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Linear interpolates a value between `a` and `b` by `t`. If `t` is 0, then the
|
|
12
|
+
* result will be `a`. If `t` is 1, then the result will be `b`. `t` will be
|
|
13
|
+
* clamped to a value between 0 and 1.
|
|
14
|
+
*
|
|
15
|
+
* @param a The start value.
|
|
16
|
+
* @param b The end value.
|
|
17
|
+
* @param t The interpolation value between 0 and 1.
|
|
18
|
+
* @returns The interpolated value between `a` and `b`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function lerp(a: number, b: number, t: number): number;
|
package/dist/matrix.d.ts
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import * as Point from './point';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a 2D transformation matrix.
|
|
4
|
-
*
|
|
5
|
-
* The values of this matrix are meant to represent a 3x3 matrix where the
|
|
6
|
-
* contents are mapped as the following:
|
|
7
|
-
*
|
|
8
|
-
* ```
|
|
9
|
-
* a b tx
|
|
10
|
-
* c d ty
|
|
11
|
-
* u v w
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export interface Matrix {
|
|
15
|
-
/**
|
|
16
|
-
* Value that affects the positioning along the x axis when scaling or
|
|
17
|
-
* rotating.
|
|
18
|
-
*/
|
|
19
|
-
a: number;
|
|
20
|
-
/**
|
|
21
|
-
* Value that affects the positioning along the y axis when rotating or
|
|
22
|
-
* skewing.
|
|
23
|
-
*/
|
|
24
|
-
b: number;
|
|
25
|
-
/**
|
|
26
|
-
* Value that affects the positioning along the x axis when rotating or
|
|
27
|
-
* skewing.
|
|
28
|
-
*/
|
|
29
|
-
c: number;
|
|
30
|
-
/**
|
|
31
|
-
* Value that affects the positioning along the y axis when scaling or
|
|
32
|
-
* rotating.
|
|
33
|
-
*/
|
|
34
|
-
d: number;
|
|
35
|
-
/**
|
|
36
|
-
* The distance to translate along the x axis.
|
|
37
|
-
*/
|
|
38
|
-
tx: number;
|
|
39
|
-
/**
|
|
40
|
-
* The distance to translate along the y axis.
|
|
41
|
-
*/
|
|
42
|
-
ty: number;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Creates a new matrix. If arguments are undefined, returns an identity matrix.
|
|
46
|
-
*/
|
|
47
|
-
export declare const create: (a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number) => Matrix;
|
|
48
|
-
/**
|
|
49
|
-
* Returns an identity matrix.
|
|
50
|
-
*/
|
|
51
|
-
export declare const identity: () => Matrix;
|
|
52
|
-
/**
|
|
53
|
-
* Creates a matrix that is translated by the given `tx` and `ty` values.
|
|
54
|
-
*/
|
|
55
|
-
export declare const translation: (tx: number, ty: number) => Matrix;
|
|
56
|
-
/**
|
|
57
|
-
* Creates a matrix that is rotated by the given degrees.
|
|
58
|
-
*/
|
|
59
|
-
export declare const rotation: (degrees: number) => Matrix;
|
|
60
|
-
/**
|
|
61
|
-
* Rotates the given matrix by the given degrees.
|
|
62
|
-
*/
|
|
63
|
-
export declare const rotate: (degrees: number, matrix: Matrix) => Matrix;
|
|
64
|
-
/**
|
|
65
|
-
* Translates the given matrix along the horizontal and vertical axis by the
|
|
66
|
-
* given `dx` and `dy` delta values.
|
|
67
|
-
*/
|
|
68
|
-
export declare const translate: (dx: number, dy: number, matrix: Matrix) => Matrix;
|
|
69
|
-
/**
|
|
70
|
-
* Returns the result of applying a geometric transformation of a matrix on the
|
|
71
|
-
* given point.
|
|
72
|
-
*/
|
|
73
|
-
export declare const transformPoint: (matrix: Matrix, pt: Point.Point) => Point.Point;
|
|
1
|
+
import * as Point from './point';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a 2D transformation matrix.
|
|
4
|
+
*
|
|
5
|
+
* The values of this matrix are meant to represent a 3x3 matrix where the
|
|
6
|
+
* contents are mapped as the following:
|
|
7
|
+
*
|
|
8
|
+
* ```
|
|
9
|
+
* a b tx
|
|
10
|
+
* c d ty
|
|
11
|
+
* u v w
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export interface Matrix {
|
|
15
|
+
/**
|
|
16
|
+
* Value that affects the positioning along the x axis when scaling or
|
|
17
|
+
* rotating.
|
|
18
|
+
*/
|
|
19
|
+
a: number;
|
|
20
|
+
/**
|
|
21
|
+
* Value that affects the positioning along the y axis when rotating or
|
|
22
|
+
* skewing.
|
|
23
|
+
*/
|
|
24
|
+
b: number;
|
|
25
|
+
/**
|
|
26
|
+
* Value that affects the positioning along the x axis when rotating or
|
|
27
|
+
* skewing.
|
|
28
|
+
*/
|
|
29
|
+
c: number;
|
|
30
|
+
/**
|
|
31
|
+
* Value that affects the positioning along the y axis when scaling or
|
|
32
|
+
* rotating.
|
|
33
|
+
*/
|
|
34
|
+
d: number;
|
|
35
|
+
/**
|
|
36
|
+
* The distance to translate along the x axis.
|
|
37
|
+
*/
|
|
38
|
+
tx: number;
|
|
39
|
+
/**
|
|
40
|
+
* The distance to translate along the y axis.
|
|
41
|
+
*/
|
|
42
|
+
ty: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new matrix. If arguments are undefined, returns an identity matrix.
|
|
46
|
+
*/
|
|
47
|
+
export declare const create: (a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number) => Matrix;
|
|
48
|
+
/**
|
|
49
|
+
* Returns an identity matrix.
|
|
50
|
+
*/
|
|
51
|
+
export declare const identity: () => Matrix;
|
|
52
|
+
/**
|
|
53
|
+
* Creates a matrix that is translated by the given `tx` and `ty` values.
|
|
54
|
+
*/
|
|
55
|
+
export declare const translation: (tx: number, ty: number) => Matrix;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a matrix that is rotated by the given degrees.
|
|
58
|
+
*/
|
|
59
|
+
export declare const rotation: (degrees: number) => Matrix;
|
|
60
|
+
/**
|
|
61
|
+
* Rotates the given matrix by the given degrees.
|
|
62
|
+
*/
|
|
63
|
+
export declare const rotate: (degrees: number, matrix: Matrix) => Matrix;
|
|
64
|
+
/**
|
|
65
|
+
* Translates the given matrix along the horizontal and vertical axis by the
|
|
66
|
+
* given `dx` and `dy` delta values.
|
|
67
|
+
*/
|
|
68
|
+
export declare const translate: (dx: number, dy: number, matrix: Matrix) => Matrix;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the result of applying a geometric transformation of a matrix on the
|
|
71
|
+
* given point.
|
|
72
|
+
*/
|
|
73
|
+
export declare const transformPoint: (matrix: Matrix, pt: Point.Point) => Point.Point;
|
package/dist/matrix2.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import * as Point from './point';
|
|
2
|
-
/**
|
|
3
|
-
* A 2x2 matrix. The contents are mapped as follows:
|
|
4
|
-
*
|
|
5
|
-
* ```
|
|
6
|
-
* a b
|
|
7
|
-
* c d
|
|
8
|
-
* ```
|
|
9
|
-
*/
|
|
10
|
-
export interface Matrix {
|
|
11
|
-
a: number;
|
|
12
|
-
b: number;
|
|
13
|
-
c: number;
|
|
14
|
-
d: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Creates a new matrix.
|
|
18
|
-
*/
|
|
19
|
-
export declare function create(a: Point.Point, b: Point.Point): Matrix;
|
|
20
|
-
export declare function create(a: number, b: number, c: number, d: number): Matrix;
|
|
21
|
-
export declare function create(): Matrix;
|
|
22
|
-
/**
|
|
23
|
-
* Returns the determinant of the provided matrix.
|
|
24
|
-
*/
|
|
25
|
-
export declare function determinant(matrix: Matrix): number;
|
|
26
|
-
/**
|
|
27
|
-
* Returns the dot product of the two vectors represented in this matrix.
|
|
28
|
-
*/
|
|
29
|
-
export declare function dot(matrix: Matrix): number;
|
|
1
|
+
import * as Point from './point';
|
|
2
|
+
/**
|
|
3
|
+
* A 2x2 matrix. The contents are mapped as follows:
|
|
4
|
+
*
|
|
5
|
+
* ```
|
|
6
|
+
* a b
|
|
7
|
+
* c d
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export interface Matrix {
|
|
11
|
+
a: number;
|
|
12
|
+
b: number;
|
|
13
|
+
c: number;
|
|
14
|
+
d: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new matrix.
|
|
18
|
+
*/
|
|
19
|
+
export declare function create(a: Point.Point, b: Point.Point): Matrix;
|
|
20
|
+
export declare function create(a: number, b: number, c: number, d: number): Matrix;
|
|
21
|
+
export declare function create(): Matrix;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the determinant of the provided matrix.
|
|
24
|
+
*/
|
|
25
|
+
export declare function determinant(matrix: Matrix): number;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the dot product of the two vectors represented in this matrix.
|
|
28
|
+
*/
|
|
29
|
+
export declare function dot(matrix: Matrix): number;
|