Socket
Socket
Sign inDemoInstall

@mathigon/euclid

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mathigon/euclid - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

1

dist/arc.d.ts

@@ -22,2 +22,3 @@ import { Line } from './line';

transform(m: TransformMatrix): this;
/** Rotates this arc by a given angle (in radians), optionally around point `c`. */
rotate(a: number, c?: Point): this;

@@ -24,0 +25,0 @@ reflect(l: Line): this;

@@ -29,2 +29,3 @@ import { Arc } from './arc';

equals(other: Circle, tolerance?: number): boolean;
toString(): string;
}

@@ -232,2 +232,5 @@ var __create = Object.create;

}
toString() {
return `Point(x: ${this.x}, y: ${this.y})`;
}
};

@@ -410,2 +413,5 @@ var ORIGIN = new Point(0, 0);

}
toString() {
return `Line(p1: ${this.p1}, p2: ${this.p2})`;
}
};

@@ -425,2 +431,5 @@ var Ray = class extends Line {

}
toString() {
return `Ray(p1: ${this.p1}, p2: ${this.p2})`;
}
};

@@ -460,2 +469,5 @@ var Segment = class extends Line {

}
toString() {
return `Segment(p1: ${this.p1}, p2: ${this.p2})`;
}
};

@@ -1071,2 +1083,5 @@

}
toString() {
return `Circle(c: ${this.c}, r: ${this.r})`;
}
};

@@ -1373,2 +1388,5 @@

}
centerAt(on = ORIGIN) {
return this.translate(on.subtract(this.centroid));
}
transform(m) {

@@ -1551,2 +1569,5 @@ return new this.constructor(...this.points.map((p) => p.transform(m)));

}
toString() {
return `Rectangle(p: ${this.p}, w: ${this.w}, h: ${this.h})`;
}
};

@@ -1553,0 +1574,0 @@

@@ -168,2 +168,5 @@ // src/angle.ts

}
toString() {
return `Point(x: ${this.x}, y: ${this.y})`;
}
};

@@ -346,2 +349,5 @@ var ORIGIN = new Point(0, 0);

}
toString() {
return `Line(p1: ${this.p1}, p2: ${this.p2})`;
}
};

@@ -361,2 +367,5 @@ var Ray = class extends Line {

}
toString() {
return `Ray(p1: ${this.p1}, p2: ${this.p2})`;
}
};

@@ -396,2 +405,5 @@ var Segment = class extends Line {

}
toString() {
return `Segment(p1: ${this.p1}, p2: ${this.p2})`;
}
};

@@ -1007,2 +1019,5 @@

}
toString() {
return `Circle(c: ${this.c}, r: ${this.r})`;
}
};

@@ -1309,2 +1324,5 @@

}
centerAt(on = ORIGIN) {
return this.translate(on.subtract(this.centroid));
}
transform(m) {

@@ -1487,2 +1505,5 @@ return new this.constructor(...this.points.map((p) => p.transform(m)));

}
toString() {
return `Rectangle(p: ${this.p}, w: ${this.w}, h: ${this.h})`;
}
};

@@ -1489,0 +1510,0 @@

@@ -44,2 +44,3 @@ import { Point } from './point';

transform(m: TransformMatrix): this;
/** Rotates this line by a given angle (in radians), optionally around point `c`. */
rotate(a: number, c?: Point): this;

@@ -51,2 +52,3 @@ reflect(l: Line): this;

equals(other: Line, tolerance?: number): boolean;
toString(): string;
}

@@ -58,2 +60,3 @@ /** An infinite ray defined by an endpoint and another point on the ray. */

equals(other: Ray, tolerance?: number): boolean;
toString(): string;
}

@@ -69,2 +72,3 @@ /** A finite line segment defined by its two endpoints. */

equals(other: Segment, tolerance?: number, oriented?: boolean): boolean;
toString(): string;
}

3

dist/point.d.ts

@@ -50,3 +50,3 @@ import { Bounds } from './bounds';

transform(m: TransformMatrix): Point;
/** Rotates this point by a given angle (in radians) around c. */
/** Rotates this point by a given angle (in radians) around point `c`. */
rotate(angle: number, c?: SimplePoint): Point;

@@ -59,3 +59,4 @@ /** Reflects this point across a line l. */

equals(other: any, precision?: number): boolean;
toString(): string;
}
export declare const ORIGIN: Point;

@@ -39,3 +39,6 @@ import { Circle } from './circle';

project(p: Point): Point;
/** Center this polygon on a given point or the origin */
centerAt(on?: Point): this;
transform(m: TransformMatrix): this;
/** Rotates this polygon by a given angle (in radians), optionally around point `center`. */
rotate(a: number, center?: Point): this;

@@ -42,0 +45,0 @@ reflect(line: Line): this;

@@ -29,2 +29,3 @@ import { Line } from './line';

transform(m: TransformMatrix): Polygon;
/** Rotates this rectangle by a given angle (in radians), optionally around point `c`. */
rotate(a: number, c?: Point): this | Polygon;

@@ -36,2 +37,3 @@ reflect(l: Line): Polygon;

equals(_other: Polygon): boolean;
toString(): string;
}
{
"name": "@mathigon/euclid",
"version": "1.0.3",
"version": "1.0.4",
"license": "MIT",

@@ -31,17 +31,17 @@ "homepage": "https://mathigon.io/euclid",

"dependencies": {
"@mathigon/core": "1.0.3",
"@mathigon/fermat": "1.0.3"
"@mathigon/core": "1.0.5",
"@mathigon/fermat": "1.0.6"
},
"devDependencies": {
"@types/tape": "4.13.2",
"@typescript-eslint/eslint-plugin": "4.30.0",
"@typescript-eslint/parser": "4.30.0",
"esbuild": "0.12.24",
"eslint": "7.32.0",
"eslint-plugin-import": "2.24.2",
"@typescript-eslint/eslint-plugin": "5.3.0",
"@typescript-eslint/parser": "5.3.0",
"esbuild": "0.13.12",
"eslint": "8.1.0",
"eslint-plugin-import": "2.25.2",
"tape": "5.3.1",
"ts-node": "10.2.1",
"ts-node": "10.4.0",
"tslib": "2.3.1",
"typescript": "4.4.2"
"typescript": "4.4.4"
}
}

@@ -81,2 +81,3 @@ // =============================================================================

/** Rotates this arc by a given angle (in radians), optionally around point `c`. */
rotate(a: number, c = ORIGIN): this {

@@ -83,0 +84,0 @@ if (nearlyEquals(a, 0)) return this;

@@ -97,2 +97,6 @@ // =============================================================================

}
toString() {
return `Circle(c: ${this.c}, r: ${this.r})`;
}
}

@@ -125,2 +125,3 @@ // =============================================================================

/** Rotates this line by a given angle (in radians), optionally around point `c`. */
rotate(a: number, c = ORIGIN): this {

@@ -152,2 +153,6 @@ if (nearlyEquals(a, 0)) return this;

}
toString() {
return `Line(p1: ${this.p1}, p2: ${this.p2})`;
}
}

@@ -168,2 +173,6 @@

}
toString() {
return `Ray(p1: ${this.p1}, p2: ${this.p2})`;
}
}

@@ -209,2 +218,6 @@

}
toString() {
return `Segment(p1: ${this.p1}, p2: ${this.p2})`;
}
}

@@ -171,3 +171,3 @@ // =============================================================================

/** Rotates this point by a given angle (in radians) around c. */
/** Rotates this point by a given angle (in radians) around point `c`. */
rotate(angle: number, c: SimplePoint = ORIGIN) {

@@ -218,4 +218,8 @@ if (nearlyEquals(angle, 0)) return this;

}
toString() {
return `Point(x: ${this.x}, y: ${this.y})`;
}
}
export const ORIGIN = new Point(0, 0);

@@ -216,2 +216,7 @@ // =============================================================================

/** Center this polygon on a given point or the origin */
centerAt(on = ORIGIN) {
return this.translate(on.subtract(this.centroid));
}
// ---------------------------------------------------------------------------

@@ -223,2 +228,3 @@

/** Rotates this polygon by a given angle (in radians), optionally around point `center`. */
rotate(a: number, center = ORIGIN): this {

@@ -225,0 +231,0 @@ if (nearlyEquals(a, 0)) return this;

@@ -105,2 +105,3 @@ // =============================================================================

/** Rotates this rectangle by a given angle (in radians), optionally around point `c`. */
rotate(a: number, c = ORIGIN) {

@@ -131,2 +132,6 @@ if (nearlyEquals(a, 0)) return this;

}
toString() {
return `Rectangle(p: ${this.p}, w: ${this.w}, h: ${this.h})`;
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc