math-exercises 3.0.28 → 3.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.
- package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionSquare.js +4 -0
- package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsProduct.js +4 -0
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts +11 -0
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +106 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +23 -7
- package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.js +4 -0
- package/lib/exercises/math/calcul/sign/signFromAx.d.ts.map +1 -1
- package/lib/exercises/math/calcul/sign/signFromAx.js +4 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.js +116 -0
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.js +5 -1
- package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +4 -0
- package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/functionGraphReading.js +4 -0
- package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/pieChartReading.js +4 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +4 -0
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.js +4 -0
- package/lib/exercises/math/geometry/thales/thales.d.ts +9 -9
- package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thales.js +153 -88
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +2 -2
- package/lib/exercises/math/percent/findRightCalculForPriceEvolution.d.ts +10 -0
- package/lib/exercises/math/percent/findRightCalculForPriceEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/findRightCalculForPriceEvolution.js +117 -0
- package/lib/exercises/math/percent/index.d.ts +1 -1
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.js +4 -0
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.js +10 -14
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +4 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +4 -0
- package/lib/index.d.ts +19 -18
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts +2 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +7 -1
- package/package.json +1 -1
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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2
2
|
import { Node, NodeIds, NodeOptions, NodeType } from "../node.js";
|
|
3
3
|
export declare function isLengthNode(a: Node): a is LengthNode;
|
|
4
|
+
export declare const length: (a: string) => LengthNode;
|
|
4
5
|
export declare class LengthNode implements AlgebraicNode {
|
|
5
6
|
opts?: NodeOptions | undefined;
|
|
6
7
|
segmentName: string;
|
|
@@ -17,7 +18,7 @@ export declare class LengthNode implements AlgebraicNode {
|
|
|
17
18
|
toMathjs(): string;
|
|
18
19
|
toTex(): string;
|
|
19
20
|
evaluate(vars?: Record<string, number>): number;
|
|
20
|
-
simplify():
|
|
21
|
+
simplify(): LengthNode;
|
|
21
22
|
equals(node: AlgebraicNode): boolean;
|
|
22
23
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): this;
|
|
23
24
|
derivative(varName?: string | undefined): AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lengthNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/lengthNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAClE,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;
|
|
1
|
+
{"version":3,"file":"lengthNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/lengthNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAClE,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,eAAO,MAAM,MAAM,MAAO,MAAM,eAE/B,CAAC;AACF,qBAAa,UAAW,YAAW,aAAa;IAC9C,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBACP,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW;IAUnD,cAAc;IAGd,aAAa;;;;IAMb,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAOpC,YAAY;IAGZ,QAAQ;IAIR,KAAK;IAIL,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQtC,QAAQ;IAOR,MAAM,CAAC,IAAI,EAAE,aAAa;IAG1B,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -2,6 +2,9 @@ import { NodeIds, NodeType } from "../node.js";
|
|
|
2
2
|
export function isLengthNode(a) {
|
|
3
3
|
return a.type === NodeType.mesure;
|
|
4
4
|
}
|
|
5
|
+
export const length = (a) => {
|
|
6
|
+
return new LengthNode(a);
|
|
7
|
+
};
|
|
5
8
|
export class LengthNode {
|
|
6
9
|
opts;
|
|
7
10
|
segmentName;
|
|
@@ -48,7 +51,10 @@ export class LengthNode {
|
|
|
48
51
|
return value;
|
|
49
52
|
}
|
|
50
53
|
simplify() {
|
|
51
|
-
|
|
54
|
+
const isAlphabeticallyOrdered = (str) => [...str].every((c, i, arr) => i === 0 || arr[i - 1] <= c);
|
|
55
|
+
return isAlphabeticallyOrdered(this.segmentName)
|
|
56
|
+
? this
|
|
57
|
+
: new LengthNode(this.segmentName.split("").reverse().join(""));
|
|
52
58
|
}
|
|
53
59
|
equals(node) {
|
|
54
60
|
return isLengthNode(node) && node.segmentName === this.segmentName;
|