@tscircuit/math-utils 0.0.29 → 0.0.30

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,9 @@
1
+ // src/is-point-in-bounds.ts
2
+ var isPointInBounds = (point, bounds) => {
3
+ return point.x >= bounds.minX && point.x <= bounds.maxX && point.y >= bounds.minY && point.y <= bounds.maxY;
4
+ };
5
+
6
+ export {
7
+ isPointInBounds
8
+ };
9
+ //# sourceMappingURL=chunk-TDJ6LMXM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/is-point-in-bounds.ts"],"sourcesContent":["import type { Bounds, Point } from \"./common\"\n\n/**\n * Determines if a point is inside or on the boundary of a bounds rectangle\n * @param point The point to check\n * @param bounds The bounding rectangle\n * @returns true if the point is within the bounds, false otherwise\n */\nexport const isPointInBounds = (point: Point, bounds: Bounds): boolean => {\n return (\n point.x >= bounds.minX &&\n point.x <= bounds.maxX &&\n point.y >= bounds.minY &&\n point.y <= bounds.maxY\n )\n}\n"],"mappings":";AAQO,IAAM,kBAAkB,CAAC,OAAc,WAA4B;AACxE,SACE,MAAM,KAAK,OAAO,QAClB,MAAM,KAAK,OAAO,QAClB,MAAM,KAAK,OAAO,QAClB,MAAM,KAAK,OAAO;AAEtB;","names":[]}
package/dist/index.d.ts CHANGED
@@ -14,3 +14,4 @@ export { boundsIntersection } from './bounds-intersection.js';
14
14
  export { Polygon, areBoundsCompletelyInsidePolygon, areBoundsOverlappingPolygon, 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 { isPointInBounds } from './is-point-in-bounds.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
+ isPointInBounds
13
+ } from "./chunk-TDJ6LMXM.js";
8
14
  import {
9
15
  normalizeDegrees
10
16
  } from "./chunk-P6GW5PWY.js";
@@ -40,9 +46,6 @@ import {
40
46
  orientation,
41
47
  pointToSegmentDistance
42
48
  } from "./chunk-EFLPMB4J.js";
43
- import {
44
- range
45
- } from "./chunk-KY53E6CT.js";
46
49
  import {
47
50
  boundsAreaOverlap
48
51
  } from "./chunk-YA3GC5BB.js";
@@ -89,6 +92,7 @@ export {
89
92
  getUnitVectorFromDirection,
90
93
  getUnitVectorFromPointAToB,
91
94
  grid,
95
+ isPointInBounds,
92
96
  isPointInsidePolygon,
93
97
  isRectCompletelyInsidePolygon,
94
98
  isRectOverlappingPolygon,
@@ -0,0 +1,11 @@
1
+ import { Point, Bounds } from './common.js';
2
+
3
+ /**
4
+ * Determines if a point is inside or on the boundary of a bounds rectangle
5
+ * @param point The point to check
6
+ * @param bounds The bounding rectangle
7
+ * @returns true if the point is within the bounds, false otherwise
8
+ */
9
+ declare const isPointInBounds: (point: Point, bounds: Bounds) => boolean;
10
+
11
+ export { isPointInBounds };
@@ -0,0 +1,7 @@
1
+ import {
2
+ isPointInBounds
3
+ } from "./chunk-TDJ6LMXM.js";
4
+ export {
5
+ isPointInBounds
6
+ };
7
+ //# sourceMappingURL=is-point-in-bounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
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.29",
4
+ "version": "0.0.30",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",