@tscircuit/math-utils 0.0.32 → 0.0.33

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.
@@ -0,0 +1,10 @@
1
+ // src/get-bounds-center.ts
2
+ var getBoundsCenter = (bounds) => ({
3
+ x: (bounds.minX + bounds.maxX) / 2,
4
+ y: (bounds.minY + bounds.maxY) / 2
5
+ });
6
+
7
+ export {
8
+ getBoundsCenter
9
+ };
10
+ //# sourceMappingURL=chunk-3WCUPG5S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/get-bounds-center.ts"],"sourcesContent":["import type { Bounds, Point } from \"./common\"\n\n/**\n * Calculates the center point of a bounds rectangle.\n * @param bounds Bounds object containing minX, minY, maxX, maxY\n * @returns Center point of the bounds\n */\nexport const getBoundsCenter = (bounds: Bounds): Point => ({\n x: (bounds.minX + bounds.maxX) / 2,\n y: (bounds.minY + bounds.maxY) / 2,\n})\n"],"mappings":";AAOO,IAAM,kBAAkB,CAAC,YAA2B;AAAA,EACzD,IAAI,OAAO,OAAO,OAAO,QAAQ;AAAA,EACjC,IAAI,OAAO,OAAO,OAAO,QAAQ;AACnC;","names":[]}
@@ -0,0 +1,10 @@
1
+ import { Bounds, Point } from './common.js';
2
+
3
+ /**
4
+ * Calculates the center point of a bounds rectangle.
5
+ * @param bounds Bounds object containing minX, minY, maxX, maxY
6
+ * @returns Center point of the bounds
7
+ */
8
+ declare const getBoundsCenter: (bounds: Bounds) => Point;
9
+
10
+ export { getBoundsCenter };
@@ -0,0 +1,7 @@
1
+ import {
2
+ getBoundsCenter
3
+ } from "./chunk-3WCUPG5S.js";
4
+ export {
5
+ getBoundsCenter
6
+ };
7
+ //# sourceMappingURL=get-bounds-center.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.d.ts CHANGED
@@ -14,3 +14,4 @@ export { boundsIntersection } from './bounds-intersection.js';
14
14
  export { Polygon, areBoundsCompletelyInsidePolygon, areBoundsOverlappingPolygon, isPointInsideBounds, isPointInsidePolygon, isRectCompletelyInsidePolygon, isRectOverlappingPolygon } from './polygon.js';
15
15
  export { normalizeDegrees } from './normalize-degrees.js';
16
16
  export { getBoundsFromPoints } from './get-bounds-from-points.js';
17
+ export { getBoundsCenter } from './get-bounds-center.js';
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ import {
2
+ range
3
+ } from "./chunk-KY53E6CT.js";
1
4
  import {
2
5
  pointToSegmentClosestPoint,
3
6
  segmentToBoundsMinDistance,
@@ -5,6 +8,9 @@ import {
5
8
  segmentToCircleMinDistance,
6
9
  segmentToSegmentMinDistance
7
10
  } from "./chunk-6PD3WN3Y.js";
11
+ import {
12
+ grid
13
+ } from "./chunk-U45EKA3R.js";
8
14
  import {
9
15
  normalizeDegrees
10
16
  } from "./chunk-P6GW5PWY.js";
@@ -41,9 +47,6 @@ import {
41
47
  orientation,
42
48
  pointToSegmentDistance
43
49
  } from "./chunk-EFLPMB4J.js";
44
- import {
45
- range
46
- } from "./chunk-KY53E6CT.js";
47
50
  import {
48
51
  boundsAreaOverlap
49
52
  } from "./chunk-YA3GC5BB.js";
@@ -57,6 +60,9 @@ import {
57
60
  doBoundsOverlap
58
61
  } from "./chunk-CA5ORSO4.js";
59
62
  import "./chunk-GYQ2KZV6.js";
63
+ import {
64
+ getBoundsCenter
65
+ } from "./chunk-3WCUPG5S.js";
60
66
  import {
61
67
  getBoundsFromPoints
62
68
  } from "./chunk-5N7UJNVK.js";
@@ -64,9 +70,6 @@ import {
64
70
  getUnitVectorFromDirection,
65
71
  getUnitVectorFromPointAToB
66
72
  } from "./chunk-GIGMPRPV.js";
67
- import {
68
- grid
69
- } from "./chunk-U45EKA3R.js";
70
73
  export {
71
74
  areBoundsCompletelyInsidePolygon,
72
75
  areBoundsOverlappingPolygon,
@@ -85,6 +88,7 @@ export {
85
88
  doesSegmentIntersectRect,
86
89
  findNearestPointsBetweenBoxSets,
87
90
  getBoundingBox,
91
+ getBoundsCenter,
88
92
  getBoundsFromPoints,
89
93
  getSegmentIntersection,
90
94
  getUnitVectorFromDirection,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/math-utils",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.32",
4
+ "version": "0.0.33",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",