math-exercises 3.0.19 → 3.0.21
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/lib/exercises/math/dataRepresentations/barChartReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/barChartReading.js +0 -1
- package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/functionGraphReading.js +174 -0
- package/lib/exercises/math/dataRepresentations/index.js +1 -0
- package/lib/exercises/math/derivation/derivative/inflexionPointQuadrinomials.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/inflexionPointQuadrinomials.js +68 -14
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts +13 -0
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/expFactorization.js +147 -0
- package/lib/exercises/math/functions/exponential/index.d.ts +1 -0
- package/lib/exercises/math/functions/exponential/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/index.js +1 -0
- package/lib/exercises/math/geometry/angles/recognizeAngleType.js +1 -1
- package/lib/exercises/math/geometry/euclidian/index.js +1 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts +2 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +187 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +2 -1
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +2 -1
- package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/index.js +1 -0
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts +12 -0
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/linesRelativePositions.js +140 -0
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +2 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +2 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts +6 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +99 -67
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.js +147 -0
- package/lib/exercises/math/probaStat/basicStats/calculateFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicStats/calculateFrequency.js +19 -10
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +12 -4
- package/lib/index.d.ts +25 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts +2 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +3 -3
- package/lib/math/geometry/triangle.d.ts +2 -7
- package/lib/math/geometry/triangle.d.ts.map +1 -1
- package/lib/math/geometry/triangle.js +7 -12
- package/lib/math/geometry/vector.d.ts +2 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +3 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -3
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +3 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +1 -1
- package/lib/tree/nodes/operators/scalarProductNode.d.ts +11 -0
- package/lib/tree/nodes/operators/scalarProductNode.d.ts.map +1 -0
- package/lib/tree/nodes/operators/scalarProductNode.js +16 -0
- package/lib/tree/parsers/powerParser.d.ts +1 -1
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ import { round } from "../utils/round.js";
|
|
|
7
7
|
import { randfloat } from "../utils/random/randfloat.js";
|
|
8
8
|
import { LineConstructor } from "./line.js";
|
|
9
9
|
import { reifyAlgebraic, } from "../../tree/nodes/nodeConstructor.js";
|
|
10
|
+
import { randint } from "../utils/random/randint.js";
|
|
10
11
|
export class TriangleConstructor {
|
|
11
12
|
static fromIdentifiers(identifiers) {
|
|
12
13
|
return new Triangle(identifiers.points.map((p) => PointConstructor.fromIdentifiers(p)), {
|
|
@@ -15,7 +16,7 @@ export class TriangleConstructor {
|
|
|
15
16
|
sidesLengths: identifiers.props?.sidesLengths?.map((n) => n ? reifyAlgebraic(n) : undefined),
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
static randomNiceSides({ names = ["A", "B", "C"], randomName = false, }) {
|
|
19
|
+
static randomNiceSides({ names = ["A", "B", "C"], randomName = false, intSides = false, }) {
|
|
19
20
|
let vertices = [];
|
|
20
21
|
if (randomName)
|
|
21
22
|
vertices = TriangleConstructor.randomName();
|
|
@@ -25,8 +26,8 @@ export class TriangleConstructor {
|
|
|
25
26
|
const addAngle = randfloat(Math.PI / 4, (3 * Math.PI) / 4);
|
|
26
27
|
//on construit [AC] sur (Ox) de milieu O et de taille 2*xRand
|
|
27
28
|
//puis [AB] sur (Ox) qu'on rotate
|
|
28
|
-
const xRand = randfloat(5, 8, 1);
|
|
29
|
-
const xRand2 = randfloat(-5, 5, 1);
|
|
29
|
+
const xRand = intSides ? randint(5, 9) : randfloat(5, 8, 1);
|
|
30
|
+
const xRand2 = intSides ? randint(-5, 5) : randfloat(-5, 5, 1);
|
|
30
31
|
const origin = new Point("O", (0).toTree(), (0).toTree());
|
|
31
32
|
const startA = new Point(vertices[0], (-xRand).toTree(), (0).toTree());
|
|
32
33
|
const A = startA.rotate(angle, origin);
|
|
@@ -34,9 +35,9 @@ export class TriangleConstructor {
|
|
|
34
35
|
const B = new Point(vertices[1], (-xRand + xRand2).toTree(), (0).toTree()).rotate(angle + addAngle, startA);
|
|
35
36
|
return new Triangle([A, B, C], {
|
|
36
37
|
sidesLengths: [
|
|
37
|
-
round(B.distanceTo(C), 1).toTree(),
|
|
38
|
-
round(A.distanceTo(C), 1).toTree(),
|
|
39
|
-
round(A.distanceTo(B), 1).toTree(),
|
|
38
|
+
round(B.distanceTo(C), intSides ? 0 : 1).toTree(),
|
|
39
|
+
round(A.distanceTo(C), intSides ? 0 : 1).toTree(),
|
|
40
|
+
round(A.distanceTo(B), intSides ? 0 : 1).toTree(),
|
|
40
41
|
],
|
|
41
42
|
});
|
|
42
43
|
}
|
|
@@ -105,12 +106,6 @@ export class Triangle {
|
|
|
105
106
|
},
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
|
-
/************* ✨ Codeium Command ⭐ *************/
|
|
109
|
-
/**
|
|
110
|
-
* Returns the perimeter of the triangle.
|
|
111
|
-
* @returns {number} the perimeter of the triangle.
|
|
112
|
-
*/
|
|
113
|
-
/****** fbb7c5d7-3919-4ef2-b5ba-db0d6770666d *******/
|
|
114
109
|
getPerimeter() {
|
|
115
110
|
return this.sides.reduce((acc, curr) => acc + curr.getLength(), 0);
|
|
116
111
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { AlgebraicNode } from "../../tree/nodes/algebraicNode.js";
|
|
2
2
|
import { Point } from "./point.js";
|
|
3
|
+
import { Segment } from "./segment.js";
|
|
3
4
|
export declare abstract class VectorConstructor {
|
|
4
5
|
static fromPoints(origin: Point, end: Point): Vector;
|
|
5
6
|
static random(name: string, allowNull?: boolean): Vector;
|
|
7
|
+
static fromSegment(segment: Segment): Vector;
|
|
6
8
|
}
|
|
7
9
|
export declare class Vector {
|
|
8
10
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAmBlE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAmBlE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,MAAM;IAOpD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,MAAM;IAOrD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO;CAGpC;AAED,qBAAa,MAAM;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBACL,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa;IAO5D,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAMzB,iBAAiB,IAAI,MAAM;IAM3B,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAK9B,sBAAsB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI1C,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAItC,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa;IAIrC,KAAK,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM;IAOrC,QAAQ;IAGR,aAAa,CAAC,CAAC,EAAE,MAAM;IAgBvB,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAWtB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAG5B,OAAO,IAAI,aAAa;IAUxB,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM;IAO5C,MAAM,CAAC,CAAC,EAAE,MAAM;IAIhB,YAAY;IAMZ,YAAY;IAOZ,aAAa;CAGd"}
|
|
@@ -16,6 +16,9 @@ export class VectorConstructor {
|
|
|
16
16
|
const y = new NumberNode(randint(-10, 11, !allowNull && x.value === 0 ? [0] : undefined));
|
|
17
17
|
return new Vector(name, x, y);
|
|
18
18
|
}
|
|
19
|
+
static fromSegment(segment) {
|
|
20
|
+
return VectorConstructor.fromPoints(segment.pointA, segment.pointB);
|
|
21
|
+
}
|
|
19
22
|
}
|
|
20
23
|
export class Vector {
|
|
21
24
|
name;
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU,YAEtB,CAAC"}
|
package/lib/playground.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { parseAlgebraic } from "./tree/parsers/latexParser.js";
|
|
2
1
|
export const playground = () => {
|
|
3
|
-
|
|
4
|
-
console.log(parseAlgebraic(tex).simplify().toTex());
|
|
2
|
+
// console.log(parseAlgebraic(tex).simplify().toTex());
|
|
5
3
|
};
|
|
@@ -28,5 +28,6 @@ export declare class NumberNode implements AlgebraicNode {
|
|
|
28
28
|
equals(node: AlgebraicNode): boolean;
|
|
29
29
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): this;
|
|
30
30
|
derivative(varName?: string | undefined): AlgebraicNode;
|
|
31
|
+
toFrac(): AlgebraicNode | NumberNode;
|
|
31
32
|
}
|
|
32
33
|
//# sourceMappingURL=numberNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/numberNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAkB,MAAM,8BAA8B,CAAC;AAE5E,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AACD,wBAAgB,4BAA4B,CAC1C,CAAC,EAAE,IAAI,GACN,CAAC,IAAI,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,CAE5C;AACD,8BAAsB,qBAAqB;IACzC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAAO;CAGhE;AACD,qBAAa,UAAW,YAAW,aAAa;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAmB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;gBAEjB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 -260,7 +260,7 @@ export class FractionNode {
|
|
|
260
260
|
const simplifyIteration = () => {
|
|
261
261
|
counter++;
|
|
262
262
|
if (counter > 1000)
|
|
263
|
-
throw new Error(
|
|
263
|
+
throw new Error(`should-throw Too many iterations in simplify, ${this.toTex()}`);
|
|
264
264
|
for (let i = 0; i < externalsNums.length; i++) {
|
|
265
265
|
const num = externalsNums[i];
|
|
266
266
|
for (let j = 0; j < externalsDenums.length; j++) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeOptions, ToTexOptions } from "../node.js";
|
|
2
|
+
import { Vector } from "../../../math/geometry/vector.js";
|
|
3
|
+
export declare const cdot: (a: Vector, b: Vector) => ScalarProductNode;
|
|
4
|
+
export declare class ScalarProductNode {
|
|
5
|
+
leftChild: Vector;
|
|
6
|
+
rightChild: Vector;
|
|
7
|
+
opts?: NodeOptions;
|
|
8
|
+
constructor(leftChild: Vector, rightChild: Vector, opts?: NodeOptions);
|
|
9
|
+
toTex(options?: ToTexOptions): string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=scalarProductNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarProductNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/scalarProductNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAY,YAAY,EAAE,MAAM,YAAY,CAAC;AA2BhF,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEvD,eAAO,MAAM,IAAI,MAAO,MAAM,KAAK,MAAM,sBAExC,CAAC;AAEF,qBAAa,iBAAiB;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;gBACP,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW;IAMrE,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;CAGtC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const cdot = (a, b) => {
|
|
2
|
+
return new ScalarProductNode(a, b);
|
|
3
|
+
};
|
|
4
|
+
export class ScalarProductNode {
|
|
5
|
+
leftChild;
|
|
6
|
+
rightChild;
|
|
7
|
+
opts;
|
|
8
|
+
constructor(leftChild, rightChild, opts) {
|
|
9
|
+
this.leftChild = leftChild;
|
|
10
|
+
this.rightChild = rightChild;
|
|
11
|
+
this.opts = opts;
|
|
12
|
+
}
|
|
13
|
+
toTex(options) {
|
|
14
|
+
return `${this.leftChild.toTex()}\\cdot ${this.rightChild.toTex()}`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const powerParser: (ans: string) => false | import("../nodes/operators/powerNode.js").PowerNode | import("../nodes/
|
|
1
|
+
export declare const powerParser: (ans: string) => false | import("../nodes/operators/powerNode.js").PowerNode | import("../nodes/operators/fractionNode.js").FractionNode | import("../nodes/functions/sqrtNode.js").SqrtNode;
|
|
2
2
|
//# sourceMappingURL=powerParser.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "math-exercises",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.21",
|
|
5
5
|
"description": "Math exercises generator for middle school and high school",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"files": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"testsimplify": "npx jest simplify.test.js",
|
|
20
20
|
"prepublishOnly": "npm run build",
|
|
21
21
|
"build": "tsc && tsc-alias",
|
|
22
|
-
"patch": "npm version patch && npm publish"
|
|
22
|
+
"patch": "npm run testml && npm version patch && npm publish"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [],
|
|
25
25
|
"author": "Heureux Hasard",
|