math-exercises 2.0.27 → 2.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.
Files changed (139) hide show
  1. package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
  2. package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +6 -6
  3. package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
  4. package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +10 -6
  5. package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
  6. package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +14 -7
  7. package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
  8. package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +11 -11
  9. package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
  10. package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +4 -6
  11. package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
  12. package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +3 -5
  13. package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
  14. package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +0 -5
  15. package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  16. package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +10 -16
  17. package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  18. package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.js +3 -5
  19. package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.js +4 -6
  20. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  21. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +4 -6
  22. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
  23. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.js +0 -2
  24. package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
  25. package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
  26. package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +33 -18
  27. package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
  28. package/lib/exercises/derivation/derivativeNumberReading.js +16 -3
  29. package/lib/exercises/exercise.d.ts +1 -1
  30. package/lib/exercises/exercise.d.ts.map +1 -1
  31. package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
  32. package/lib/exercises/functions/absolute/absoluteValueInequations.js +8 -5
  33. package/lib/exercises/functions/affines/affineExpressionReading.d.ts.map +1 -1
  34. package/lib/exercises/functions/affines/affineExpressionReading.js +5 -1
  35. package/lib/exercises/functions/affines/interceptReading.d.ts.map +1 -1
  36. package/lib/exercises/functions/affines/interceptReading.js +6 -2
  37. package/lib/exercises/functions/affines/leadingCoefficient.d.ts.map +1 -1
  38. package/lib/exercises/functions/affines/leadingCoefficient.js +5 -1
  39. package/lib/exercises/functions/basics/graphicEquation.d.ts.map +1 -1
  40. package/lib/exercises/functions/basics/graphicEquation.js +2 -0
  41. package/lib/exercises/functions/basics/graphicInequation.d.ts.map +1 -1
  42. package/lib/exercises/functions/basics/graphicInequation.js +2 -0
  43. package/lib/exercises/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
  44. package/lib/exercises/functions/basics/imageFunctionGeogebra.js +6 -2
  45. package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
  46. package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +4 -2
  47. package/lib/exercises/functions/exponential/expSimplifiying.d.ts.map +1 -1
  48. package/lib/exercises/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -1
  49. package/lib/exercises/functions/trinoms/canonicalFromDevForm.js +1 -3
  50. package/lib/exercises/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
  51. package/lib/exercises/functions/trinoms/secondDegreeInequation.js +0 -3
  52. package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -1
  53. package/lib/exercises/geometry/vectors/coordinatesReading.js +2 -0
  54. package/lib/exercises/index.d.ts +1 -0
  55. package/lib/exercises/index.d.ts.map +1 -1
  56. package/lib/exercises/index.js +1 -0
  57. package/lib/exercises/limits/limitReading.d.ts.map +1 -1
  58. package/lib/exercises/limits/limitReading.js +9 -1
  59. package/lib/exercises/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
  60. package/lib/exercises/limits/rationalFracForbiddenValueLimit.js +1 -6
  61. package/lib/exercises/matrices/index.d.ts +2 -0
  62. package/lib/exercises/matrices/index.d.ts.map +1 -0
  63. package/lib/exercises/matrices/index.js +17 -0
  64. package/lib/exercises/matrices/matrixInversibilityDomain.d.ts +10 -0
  65. package/lib/exercises/matrices/matrixInversibilityDomain.d.ts.map +1 -0
  66. package/lib/exercises/matrices/matrixInversibilityDomain.js +93 -0
  67. package/lib/exercises/sets/intervals/inequalityToInterval.d.ts +4 -1
  68. package/lib/exercises/sets/intervals/inequalityToInterval.d.ts.map +1 -1
  69. package/lib/exercises/sets/intervals/inequalityToInterval.js +10 -7
  70. package/lib/exercises/sets/intervals/intervalsIntersection.d.ts +7 -2
  71. package/lib/exercises/sets/intervals/intervalsIntersection.d.ts.map +1 -1
  72. package/lib/exercises/sets/intervals/intervalsIntersection.js +11 -4
  73. package/lib/exercises/sets/intervals/intervalsUnion.d.ts +7 -2
  74. package/lib/exercises/sets/intervals/intervalsUnion.d.ts.map +1 -1
  75. package/lib/exercises/sets/intervals/intervalsUnion.js +11 -4
  76. package/lib/exercises/utils/keys/intervalKeys.d.ts +3 -0
  77. package/lib/exercises/utils/keys/intervalKeys.d.ts.map +1 -0
  78. package/lib/exercises/utils/keys/intervalKeys.js +10 -0
  79. package/lib/geogebra/colors.d.ts +25 -0
  80. package/lib/geogebra/colors.d.ts.map +1 -0
  81. package/lib/geogebra/colors.js +31 -0
  82. package/lib/geogebra/geogebraConstructor.js +4 -4
  83. package/lib/index.d.ts +124 -8
  84. package/lib/index.d.ts.map +1 -1
  85. package/lib/index.js +11 -0
  86. package/lib/math/geometry/point.d.ts.map +1 -1
  87. package/lib/math/matrices/matrix.d.ts +10 -0
  88. package/lib/math/matrices/matrix.d.ts.map +1 -0
  89. package/lib/math/matrices/matrix.js +24 -0
  90. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  91. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  92. package/lib/math/numbers/decimals/decimal.js +3 -0
  93. package/lib/math/numbers/integer/integer.d.ts +1 -0
  94. package/lib/math/numbers/integer/integer.d.ts.map +1 -1
  95. package/lib/math/numbers/integer/integer.js +3 -0
  96. package/lib/math/numbers/integer/power.d.ts +1 -0
  97. package/lib/math/numbers/integer/power.d.ts.map +1 -1
  98. package/lib/math/numbers/integer/power.js +3 -0
  99. package/lib/math/numbers/logarithms/ln.d.ts +1 -0
  100. package/lib/math/numbers/logarithms/ln.d.ts.map +1 -1
  101. package/lib/math/numbers/logarithms/ln.js +3 -0
  102. package/lib/math/numbers/nombre.d.ts +5 -2
  103. package/lib/math/numbers/nombre.d.ts.map +1 -1
  104. package/lib/math/numbers/nombre.js +22 -7
  105. package/lib/math/numbers/rationals/rational.d.ts +1 -0
  106. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  107. package/lib/math/numbers/rationals/rational.js +4 -3
  108. package/lib/math/numbers/reals/real.d.ts +1 -0
  109. package/lib/math/numbers/reals/real.d.ts.map +1 -1
  110. package/lib/math/numbers/reals/real.js +3 -0
  111. package/lib/math/polynomials/affine.d.ts +20 -5
  112. package/lib/math/polynomials/affine.d.ts.map +1 -1
  113. package/lib/math/polynomials/affine.js +8 -12
  114. package/lib/math/polynomials/trinom.d.ts +40 -4
  115. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  116. package/lib/math/polynomials/trinom.js +23 -28
  117. package/lib/math/sets/intervals/intervals.d.ts +9 -12
  118. package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
  119. package/lib/math/sets/intervals/intervals.js +61 -135
  120. package/lib/math/utils/random/randint.d.ts.map +1 -1
  121. package/lib/math/utils/random/randint.js +2 -2
  122. package/lib/server.d.ts +6 -0
  123. package/lib/server.d.ts.map +1 -1
  124. package/lib/server.js +10 -0
  125. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  126. package/lib/tree/nodes/operators/fractionNode.js +40 -0
  127. package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
  128. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  129. package/lib/tree/nodes/sets/intervalNode.js +14 -2
  130. package/lib/tree/nodes/sets/majorSets.d.ts +1 -0
  131. package/lib/tree/nodes/sets/majorSets.d.ts.map +1 -0
  132. package/lib/tree/nodes/sets/majorSets.js +1 -0
  133. package/lib/tree/nodes/sets/unionIntervalNode.d.ts +4 -0
  134. package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
  135. package/lib/tree/nodes/sets/unionIntervalNode.js +13 -2
  136. package/lib/types/numberType.d.ts +1 -0
  137. package/lib/types/numberType.d.ts.map +1 -0
  138. package/lib/types/numberType.js +1 -0
  139. package/package.json +1 -1
@@ -38,12 +38,14 @@ const getInequalityToIntervalQuestion = () => {
38
38
  answerFormat: "tex",
39
39
  identifiers: {
40
40
  isIntervalToInequality: isIntervalToInequality,
41
- intervalTex: interval.tex,
41
+ intervalMin: interval.min,
42
+ intervalMax: interval.max,
43
+ intervalClosure: interval.closure,
42
44
  },
43
45
  };
44
46
  return question;
45
47
  };
46
- const getPropositions = (n, { answer, isIntervalToInequality, intervalTex }) => {
48
+ const getPropositions = (n, { answer, isIntervalToInequality, intervalClosure, intervalMax, intervalMin }) => {
47
49
  const reverseBracket = (bracket) => {
48
50
  return bracket === "[" ? "]" : "[";
49
51
  };
@@ -65,7 +67,7 @@ const getPropositions = (n, { answer, isIntervalToInequality, intervalTex }) =>
65
67
  return "<";
66
68
  return "\\le";
67
69
  };
68
- const interval = new intervals_1.Interval(intervalTex);
70
+ const interval = new intervals_1.Interval(intervalMin.toTree(), intervalMax.toTree(), intervalClosure);
69
71
  const propositions = [];
70
72
  (0, exercise_1.addValidProp)(propositions, answer);
71
73
  const xNode = new variableNode_1.VariableNode("x");
@@ -117,17 +119,18 @@ const getPropositions = (n, { answer, isIntervalToInequality, intervalTex }) =>
117
119
  }
118
120
  return (0, shuffle_1.shuffle)(propositions);
119
121
  };
120
- const isAnswerValid = (ans, { intervalTex, isIntervalToInequality }) => {
121
- const interval = new intervals_1.Interval(intervalTex).toTree();
122
- console.log(interval.toTex());
122
+ const isAnswerValid = (ans, { intervalClosure, intervalMax, intervalMin, isIntervalToInequality }) => {
123
+ const interval = new intervals_1.Interval(intervalMin.toTree(), intervalMax.toTree(), intervalClosure).toTree();
124
+ console.log("int", interval.toTex());
123
125
  const inequality = interval.toInequality();
124
126
  const answer = isIntervalToInequality
125
127
  ? inequality
126
128
  : new belongsNode_1.BelongsNode(new variableNode_1.VariableNode("x"), interval, {
127
129
  allowRawRightChildAsSolution: true,
128
130
  });
131
+ console.log("ans", answer);
129
132
  const texs = answer.toAllValidTexs();
130
- console.log(texs);
133
+ console.log("texs", texs);
131
134
  return texs.includes(ans);
132
135
  };
133
136
  exports.inequalityToInterval = {
@@ -1,7 +1,12 @@
1
1
  import { MathExercise } from "../../../exercises/exercise";
2
+ import { ClosureType } from "../../../tree/nodes/sets/intervalNode";
2
3
  type Identifiers = {
3
- int1Tex: string;
4
- int2Tex: string;
4
+ int1Min: number;
5
+ int1Max: number;
6
+ int1Closure: ClosureType;
7
+ int2Min: number;
8
+ int2Max: number;
9
+ int2Closure: ClosureType;
5
10
  };
6
11
  export declare const intervalsIntersection: MathExercise<Identifiers>;
7
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAiDF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAa3D,CAAC"}
1
+ {"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGjE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAwDF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAa3D,CAAC"}
@@ -22,15 +22,22 @@ const getIntervalsIntersectionQuestion = () => {
22
22
  "cap",
23
23
  ],
24
24
  answerFormat: "tex",
25
- identifiers: { int1Tex: int1.tex, int2Tex: int2.tex },
25
+ identifiers: {
26
+ int1Closure: int1.closure,
27
+ int1Max: int1.max,
28
+ int1Min: int1.min,
29
+ int2Closure: int2.closure,
30
+ int2Max: int2.max,
31
+ int2Min: int2.min,
32
+ },
26
33
  };
27
34
  return question;
28
35
  };
29
- const getPropositions = (n, { answer, int1Tex, int2Tex }) => {
36
+ const getPropositions = (n, { answer, int1Closure, int1Max, int1Min, int2Closure, int2Max, int2Min }) => {
30
37
  const propositions = [];
31
38
  (0, exercise_1.addValidProp)(propositions, answer);
32
- const int1 = new intervals_1.Interval(int1Tex);
33
- const int2 = new intervals_1.Interval(int2Tex);
39
+ const int1 = new intervals_1.Interval(int1Min.toTree(), int1Max.toTree(), int1Closure);
40
+ const int2 = new intervals_1.Interval(int2Min.toTree(), int2Max.toTree(), int2Closure);
34
41
  (0, exercise_1.tryToAddWrongProp)(propositions, int1.union(int2).tex);
35
42
  while (propositions.length < n) {
36
43
  const wrongAnswer = intervals_1.IntervalConstructor.random().tex;
@@ -1,7 +1,12 @@
1
1
  import { MathExercise } from "../../../exercises/exercise";
2
+ import { ClosureType } from "../../../tree/nodes/sets/intervalNode";
2
3
  type Identifiers = {
3
- int1Tex: string;
4
- int2Tex: string;
4
+ int1Min: number;
5
+ int1Max: number;
6
+ int1Closure: ClosureType;
7
+ int2Min: number;
8
+ int2Max: number;
9
+ int2Closure: ClosureType;
5
10
  };
6
11
  export declare const intervalsUnion: MathExercise<Identifiers>;
7
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsCF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}
1
+ {"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGjE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AA6CF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}
@@ -14,15 +14,22 @@ const getIntervalsUnionQuestion = () => {
14
14
  instruction: `Soit $I = ${int1.tex}$ et $J = ${int2.tex}$. Déterminer $I\\cup J$.`,
15
15
  keys: ["infty", "lbracket", "rbracket", "semicolon", "cup", "cap"],
16
16
  answerFormat: "tex",
17
- identifiers: { int1Tex: int1.tex, int2Tex: int2.tex },
17
+ identifiers: {
18
+ int1Closure: int1.closure,
19
+ int1Max: int1.max,
20
+ int1Min: int1.min,
21
+ int2Closure: int2.closure,
22
+ int2Max: int2.max,
23
+ int2Min: int2.min,
24
+ },
18
25
  };
19
26
  return question;
20
27
  };
21
- const getPropositions = (n, { answer, int1Tex, int2Tex }) => {
28
+ const getPropositions = (n, { answer, int1Closure, int1Max, int1Min, int2Closure, int2Max, int2Min }) => {
22
29
  const propositions = [];
23
30
  (0, exercise_1.addValidProp)(propositions, answer);
24
- const int1 = new intervals_1.Interval(int1Tex);
25
- const int2 = new intervals_1.Interval(int2Tex);
31
+ const int1 = new intervals_1.Interval(int1Min.toTree(), int1Max.toTree(), int1Closure);
32
+ const int2 = new intervals_1.Interval(int2Min.toTree(), int2Max.toTree(), int2Closure);
26
33
  (0, exercise_1.tryToAddWrongProp)(propositions, int1.intersection(int2).tex);
27
34
  while (propositions.length < n) {
28
35
  const wrongAnswer = intervals_1.IntervalConstructor.random().tex;
@@ -0,0 +1,3 @@
1
+ import { KeyId } from "../../../types/keyIds";
2
+ export declare const intervalKeys: KeyId[];
3
+ //# sourceMappingURL=intervalKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intervalKeys.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/keys/intervalKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,eAAO,MAAM,YAAY,EAAE,KAAK,EAM/B,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.intervalKeys = void 0;
4
+ exports.intervalKeys = [
5
+ "lbracket",
6
+ "rbracket",
7
+ "semicolon",
8
+ "cup",
9
+ "infty",
10
+ ];
@@ -0,0 +1,25 @@
1
+ export declare const red = "#FF3333";
2
+ export declare const pinkDark = "#A10039";
3
+ export declare const pinkMain = "#D83F63";
4
+ export declare const pinkLight = "#FF7390";
5
+ export declare const reds: string[];
6
+ export declare const orangeDark = "#BE5F00";
7
+ export declare const orange = "#F6A118";
8
+ export declare const orangeLight = "#FFBE46";
9
+ export declare const oranges: string[];
10
+ export declare const greenLight = "#54B1B7";
11
+ export declare const greenMain = "#168187";
12
+ export declare const greenDark = "#00545A";
13
+ export declare const greens: string[];
14
+ export declare const blueLight = "#769DFF";
15
+ export declare const blueDark = "#0045AB";
16
+ export declare const blueMain = "#376FDE";
17
+ export declare const blueExtraDark = "#00035D";
18
+ export declare const blues: string[];
19
+ export declare const purpleLight = "#BA86FF";
20
+ export declare const purpleMain = "#8657DE";
21
+ export declare const purpleDark = "#522AAB";
22
+ export declare const purples: string[];
23
+ export declare const colors: string[];
24
+ export declare const randomColor: () => string;
25
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/geogebra/colors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,YAAY,CAAC;AAC7B,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,SAAS,YAAY,CAAC;AACnC,eAAO,MAAM,IAAI,UAAuC,CAAC;AAEzD,eAAO,MAAM,UAAU,YAAY,CAAC;AACpC,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,OAAO,UAAoC,CAAC;AAEzD,eAAO,MAAM,UAAU,YAAY,CAAC;AACpC,eAAO,MAAM,SAAS,YAAY,CAAC;AACnC,eAAO,MAAM,SAAS,YAAY,CAAC;AACnC,eAAO,MAAM,MAAM,UAAqC,CAAC;AAEzD,eAAO,MAAM,SAAS,YAAY,CAAC;AACnC,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,KAAK,UAAiD,CAAC;AAEpE,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,UAAU,YAAY,CAAC;AACpC,eAAO,MAAM,UAAU,YAAY,CAAC;AACpC,eAAO,MAAM,OAAO,UAAwC,CAAC;AAC7D,eAAO,MAAM,MAAM,UAAyD,CAAC;AAE7E,eAAO,MAAM,WAAW,cAEvB,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.randomColor = exports.colors = exports.purples = exports.purpleDark = exports.purpleMain = exports.purpleLight = exports.blues = exports.blueExtraDark = exports.blueMain = exports.blueDark = exports.blueLight = exports.greens = exports.greenDark = exports.greenMain = exports.greenLight = exports.oranges = exports.orangeLight = exports.orange = exports.orangeDark = exports.reds = exports.pinkLight = exports.pinkMain = exports.pinkDark = exports.red = void 0;
4
+ const random_1 = require("../utils/random");
5
+ exports.red = "#FF3333";
6
+ exports.pinkDark = "#A10039";
7
+ exports.pinkMain = "#D83F63";
8
+ exports.pinkLight = "#FF7390";
9
+ exports.reds = [exports.red, exports.pinkDark, exports.pinkLight, exports.pinkMain];
10
+ exports.orangeDark = "#BE5F00";
11
+ exports.orange = "#F6A118";
12
+ exports.orangeLight = "#FFBE46";
13
+ exports.oranges = [exports.orange, exports.orangeDark, exports.orangeLight];
14
+ exports.greenLight = "#54B1B7";
15
+ exports.greenMain = "#168187";
16
+ exports.greenDark = "#00545A";
17
+ exports.greens = [exports.greenDark, exports.greenLight, exports.greenMain];
18
+ exports.blueLight = "#769DFF";
19
+ exports.blueDark = "#0045AB";
20
+ exports.blueMain = "#376FDE";
21
+ exports.blueExtraDark = "#00035D";
22
+ exports.blues = [exports.blueDark, exports.blueExtraDark, exports.blueLight, exports.blueMain];
23
+ exports.purpleLight = "#BA86FF";
24
+ exports.purpleMain = "#8657DE";
25
+ exports.purpleDark = "#522AAB";
26
+ exports.purples = [exports.purpleDark, exports.purpleLight, exports.purpleMain];
27
+ exports.colors = [...exports.reds, ...exports.oranges, ...exports.greens, ...exports.blues, ...exports.purples];
28
+ const randomColor = () => {
29
+ return (0, random_1.random)(exports.colors);
30
+ };
31
+ exports.randomColor = randomColor;
@@ -16,10 +16,10 @@ class GeogebraConstructor {
16
16
  const xDelta = xMax - xMin;
17
17
  const yDelta = yMax - yMin;
18
18
  const coords = [
19
- xMin === xMax ? xMin - 1 : xMin - 0.2 * Math.abs(xDelta),
20
- xMin === xMax ? xMax + 1 : xMax + 0.2 * Math.abs(xDelta),
21
- yMin === yMax ? yMin - 1 : yMin - 0.2 * Math.abs(yDelta),
22
- yMin === yMax ? yMax + 1 : yMax + 0.2 * Math.abs(yDelta),
19
+ xMin === xMax ? xMin - 1 : xMin - Math.max(1, 0.2 * Math.abs(xDelta)),
20
+ xMin === xMax ? xMax + 1 : xMax + Math.max(1, 0.2 * Math.abs(xDelta)),
21
+ yMin === yMax ? yMin - 1 : yMin - Math.max(1, 0.2 * Math.abs(yDelta)),
22
+ yMin === yMax ? yMax + 1 : yMax + Math.max(1, 0.2 * Math.abs(yDelta)),
23
23
  ];
24
24
  if (showAxes) {
25
25
  coords[0] = Math.min(-1, coords[0]);
package/lib/index.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ declare global {
2
+ interface Number {
3
+ toTree: () => AlgebraicNode;
4
+ }
5
+ }
6
+ import { AlgebraicNode } from "./tree/nodes/algebraicNode";
1
7
  declare const mathExercises: (import("./exercises/exercise").MathExercise<{
2
8
  chosenNumbers: number[];
3
9
  }> | import("./exercises/exercise").MathExercise<{
@@ -32,6 +38,38 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
32
38
  rationalNum: [number, number];
33
39
  rationalDenum: [number, number];
34
40
  }> | import("./exercises/exercise").MathExercise<{
41
+ /**
42
+ * TODO
43
+ * Décimal : permettre facilement -0.xxx
44
+ * Tree shaking export
45
+ *
46
+ * VEA:
47
+ * -> -3x est bien transofmré en -3*x, x*(-3) mais pas en -x*3
48
+ * ->> faire le meme delire que pour les power mais pour les opposite ?
49
+ * c'est à dire créer toutes les permuts en déplacant le moins qquepart
50
+ * -> faire des nodes pour les Ensembles de nombre
51
+ *
52
+ * !-> choses pour lesquelles la v1 ne marchera pas :
53
+ * !-- fractions non réduites
54
+ * !-- nbs décimaux avec des 0
55
+ * !-- nb quelconque de moins, genre -3*-4 ou -x/-y
56
+ * !-> pour ces choses là il faut obligatoirement parser la rpéonse élève ?
57
+ *
58
+ * Passer les sqrtNode en tree-iable
59
+ *
60
+ *
61
+ *
62
+ * !!!à fix :
63
+ * ! fraction réductible
64
+ * ! 0,20 au lieu de 0,2
65
+ * ! moins partout dans fraction
66
+ * !puissances négatives vers inverse fraction
67
+ * ! simplification du ln
68
+ * ! meileure gestion des [] : le clavier devriat pouvoir produire des left/right ;
69
+ * !aussi en tapant [ puis diviser, le crochet passe en numérateur
70
+ * ! espace tous les 3 chiffres dans un nb (le clavier doit le fournir aussi!)
71
+
72
+ */
35
73
  rational: [number, number];
36
74
  rational2: [number, number];
37
75
  }> | import("./exercises/exercise").MathExercise<{
@@ -453,6 +491,38 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
453
491
  signs: number[];
454
492
  isLog10: boolean;
455
493
  }> | import("./exercises/exercise").MathExercise<{
494
+ /**
495
+ * TODO
496
+ * Décimal : permettre facilement -0.xxx
497
+ * Tree shaking export
498
+ *
499
+ * VEA:
500
+ * -> -3x est bien transofmré en -3*x, x*(-3) mais pas en -x*3
501
+ * ->> faire le meme delire que pour les power mais pour les opposite ?
502
+ * c'est à dire créer toutes les permuts en déplacant le moins qquepart
503
+ * -> faire des nodes pour les Ensembles de nombre
504
+ *
505
+ * !-> choses pour lesquelles la v1 ne marchera pas :
506
+ * !-- fractions non réduites
507
+ * !-- nbs décimaux avec des 0
508
+ * !-- nb quelconque de moins, genre -3*-4 ou -x/-y
509
+ * !-> pour ces choses là il faut obligatoirement parser la rpéonse élève ?
510
+ *
511
+ * Passer les sqrtNode en tree-iable
512
+ *
513
+ *
514
+ *
515
+ * !!!à fix :
516
+ * ! fraction réductible
517
+ * ! 0,20 au lieu de 0,2
518
+ * ! moins partout dans fraction
519
+ * !puissances négatives vers inverse fraction
520
+ * ! simplification du ln
521
+ * ! meileure gestion des [] : le clavier devriat pouvoir produire des left/right ;
522
+ * !aussi en tapant [ puis diviser, le crochet passe en numérateur
523
+ * ! espace tous les 3 chiffres dans un nb (le clavier doit le fournir aussi!)
524
+
525
+ */
456
526
  coin: boolean;
457
527
  radius: number;
458
528
  diametre: number;
@@ -588,6 +658,11 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
588
658
  to: string;
589
659
  from: string | undefined;
590
660
  a: number | undefined;
661
+ }> | import("./exercises/exercise").MathExercise<{
662
+ a: string;
663
+ b: string;
664
+ c: string;
665
+ d: string;
591
666
  }> | import("./exercises/exercise").MathExercise<{
592
667
  randNbr: number;
593
668
  randPercent: number;
@@ -596,7 +671,38 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
596
671
  rate: number;
597
672
  nbMois: number;
598
673
  }> | import("./exercises/exercise").MathExercise<{
599
- isFromEvolutionToCM: boolean;
674
+ isFromEvolutionToCM: boolean; /**
675
+ * TODO
676
+ * Décimal : permettre facilement -0.xxx
677
+ * Tree shaking export
678
+ *
679
+ * VEA:
680
+ * -> -3x est bien transofmré en -3*x, x*(-3) mais pas en -x*3
681
+ * ->> faire le meme delire que pour les power mais pour les opposite ?
682
+ * c'est à dire créer toutes les permuts en déplacant le moins qquepart
683
+ * -> faire des nodes pour les Ensembles de nombre
684
+ *
685
+ * !-> choses pour lesquelles la v1 ne marchera pas :
686
+ * !-- fractions non réduites
687
+ * !-- nbs décimaux avec des 0
688
+ * !-- nb quelconque de moins, genre -3*-4 ou -x/-y
689
+ * !-> pour ces choses là il faut obligatoirement parser la rpéonse élève ?
690
+ *
691
+ * Passer les sqrtNode en tree-iable
692
+ *
693
+ *
694
+ *
695
+ * !!!à fix :
696
+ * ! fraction réductible
697
+ * ! 0,20 au lieu de 0,2
698
+ * ! moins partout dans fraction
699
+ * !puissances négatives vers inverse fraction
700
+ * ! simplification du ln
701
+ * ! meileure gestion des [] : le clavier devriat pouvoir produire des left/right ;
702
+ * !aussi en tapant [ puis diviser, le crochet passe en numérateur
703
+ * ! espace tous les 3 chiffres dans un nb (le clavier doit le fournir aussi!)
704
+
705
+ */
600
706
  evolution: number;
601
707
  }> | import("./exercises/exercise").MathExercise<{
602
708
  evolutions: string[];
@@ -760,13 +866,23 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
760
866
  coeffs: number[];
761
867
  }> | import("./exercises/exercise").MathExercise<{
762
868
  isIntervalToInequality: boolean;
763
- intervalTex: string;
764
- }> | import("./exercises/exercise").MathExercise<{
765
- int1Tex: string;
766
- int2Tex: string;
767
- }> | import("./exercises/exercise").MathExercise<{
768
- int1Tex: string;
769
- int2Tex: string;
869
+ intervalMin: number;
870
+ intervalMax: number;
871
+ intervalClosure: import("./tree/nodes/sets/intervalNode").ClosureType;
872
+ }> | import("./exercises/exercise").MathExercise<{
873
+ int1Min: number;
874
+ int1Max: number;
875
+ int1Closure: import("./tree/nodes/sets/intervalNode").ClosureType;
876
+ int2Min: number;
877
+ int2Max: number;
878
+ int2Closure: import("./tree/nodes/sets/intervalNode").ClosureType;
879
+ }> | import("./exercises/exercise").MathExercise<{
880
+ int1Min: number;
881
+ int1Max: number;
882
+ int1Closure: import("./tree/nodes/sets/intervalNode").ClosureType;
883
+ int2Min: number;
884
+ int2Max: number;
885
+ int2Closure: import("./tree/nodes/sets/intervalNode").ClosureType;
770
886
  }> | import("./exercises/exercise").MathExercise<{
771
887
  type: number;
772
888
  nb: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqCA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA2B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;KAC7B;CACF;AA6CD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAtCnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA/BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA/BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAO4C,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/lib/index.js CHANGED
@@ -24,6 +24,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.mathExercises = void 0;
27
+ // import { exercises } from "./exercises/exercises";
28
+ const numberNode_1 = require("./tree/nodes/numbers/numberNode");
29
+ Number.prototype.toTree = function () {
30
+ const value = this.valueOf();
31
+ if (value === Infinity)
32
+ return infiniteNode_1.PlusInfinityNode;
33
+ if (value === -Infinity)
34
+ return infiniteNode_1.MinusInfinityNode;
35
+ return new numberNode_1.NumberNode(value);
36
+ };
27
37
  /**
28
38
  * TODO
29
39
  * Décimal : permettre facilement -0.xxx
@@ -57,5 +67,6 @@ exports.mathExercises = void 0;
57
67
 
58
68
  */
59
69
  const Exercises = __importStar(require("./exercises"));
70
+ const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
60
71
  const mathExercises = Object.values(Exercises);
61
72
  exports.mathExercises = mathExercises;
@@ -1 +1 @@
1
- {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAMlC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;CAevC;AAED,qBAAa,KAAK;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBACL,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa;IAM5D,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAGzB,QAAQ,IAAI,MAAM;IAIlB,UAAU,IAAI,MAAM;IAMpB,UAAU,IAAI,MAAM;IAMpB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAiBrC,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAM5B,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO;IAGzB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK;CAK7B"}
1
+ {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAMlC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;CAevC;AAED,qBAAa,KAAK;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBACL,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa;IAM5D,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAGzB,QAAQ,IAAI,MAAM;IAIlB,UAAU,IAAI,MAAM;IAMpB,UAAU,IAAI,MAAM;IAMpB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAiBrC,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAM5B,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO;IAGzB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK;CAK7B"}
@@ -0,0 +1,10 @@
1
+ import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
2
+ export declare class Matrix {
3
+ elements: AlgebraicNode[][];
4
+ rows: number;
5
+ columns: number;
6
+ constructor(elements: AlgebraicNode[][]);
7
+ determinant(): AlgebraicNode;
8
+ toTex(): string;
9
+ }
10
+ //# sourceMappingURL=matrix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../src/math/matrices/matrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,qBAAa,MAAM;IACjB,QAAQ,EAAE,aAAa,EAAE,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;gBACJ,QAAQ,EAAE,aAAa,EAAE,EAAE;IAKvC,WAAW;IAUX,KAAK;CAKN"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Matrix = void 0;
4
+ const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
5
+ const substractNode_1 = require("../../tree/nodes/operators/substractNode");
6
+ class Matrix {
7
+ constructor(elements) {
8
+ this.elements = elements;
9
+ this.columns = elements[0].length;
10
+ this.rows = elements.length;
11
+ }
12
+ determinant() {
13
+ if (this.rows === 2 && this.columns === 2) {
14
+ return new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(this.elements[0][0], this.elements[1][1]), new multiplyNode_1.MultiplyNode(this.elements[0][1], this.elements[1][0])).simplify();
15
+ }
16
+ throw Error("general determinant not implemented yet");
17
+ }
18
+ toTex() {
19
+ return `\\begin{pmatrix}${this.elements
20
+ .map((row) => `${row.map((cell) => cell.toTex()).join("&")} \\\\[6pt]`)
21
+ .join("")}\\end{pmatrix}`;
22
+ }
23
+ }
24
+ exports.Matrix = Matrix;
@@ -16,6 +16,7 @@ export declare class Decimal implements Nombre {
16
16
  intPart: number;
17
17
  decimalPart: string;
18
18
  constructor(value: number);
19
+ equals(n: Nombre): boolean;
19
20
  /**
20
21
  *
21
22
  * @param precision 0 = unité, 1 = dixieme, ... , -1 : dizaine
@@ -1 +1 @@
1
- {"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/decimals/decimal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,GAAE,MAAU,GAAG,MAAM;IAY1E,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;IAMpE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;IAK/D,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;CAMrD;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,aAAsB;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;gBACR,KAAK,EAAE,MAAM;IASzB;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIhC,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAkClC,gBAAgB;IA2BhB,oBAAoB;IAsBpB,UAAU;IAMV,MAAM;CAGP"}
1
+ {"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/decimals/decimal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,GAAE,MAAU,GAAG,MAAM;IAY1E,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;IAMpE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;IAK/D,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;CAMrD;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,aAAsB;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;gBACR,KAAK,EAAE,MAAM;IASzB,MAAM,CAAC,CAAC,EAAE,MAAM;IAIhB;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIhC,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAkClC,gBAAgB;IA2BhB,oBAAoB;IAsBpB,UAAU;IAMV,MAAM;CAGP"}
@@ -52,6 +52,9 @@ class Decimal {
52
52
  this.decimalPart = decimalPartString || "";
53
53
  this.precision = this.decimalPart.length;
54
54
  }
55
+ equals(n) {
56
+ return this.value === n.value;
57
+ }
55
58
  /**
56
59
  *
57
60
  * @param precision 0 = unité, 1 = dixieme, ... , -1 : dizaine
@@ -11,6 +11,7 @@ export declare class Integer implements Nombre {
11
11
  tex: string;
12
12
  type: NumberType;
13
13
  constructor(value: number, tex?: string);
14
+ equals(n: Nombre): boolean;
14
15
  toTree(): NumberNode;
15
16
  round(precision: number): Integer;
16
17
  divide(nb: Nombre): Nombre;
@@ -1 +1 @@
1
- {"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/integer/integer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrD,MAAM,CAAC,WAAW,CAAC,GAAG,GAAE,MAAW;IAGnC,MAAM,CAAC,gBAAgB,CACrB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,QAAQ,CAAC,EAAE,MAAM,EAAE;CAYtB;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBAEL,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAMvC,MAAM;IAIN,KAAK,CAAC,SAAS,EAAE,MAAM;IAkCvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAc1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAYxC,QAAQ;IAGR,GAAG,CAAC,EAAE,EAAE,MAAM;CAYf"}
1
+ {"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/integer/integer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrD,MAAM,CAAC,WAAW,CAAC,GAAG,GAAE,MAAW;IAGnC,MAAM,CAAC,gBAAgB,CACrB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,QAAQ,CAAC,EAAE,MAAM,EAAE;CAYtB;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBAEL,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAMvC,MAAM,CAAC,CAAC,EAAE,MAAM;IAGhB,MAAM;IAIN,KAAK,CAAC,SAAS,EAAE,MAAM;IAkCvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAc1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAYxC,QAAQ;IAGR,GAAG,CAAC,EAAE,EAAE,MAAM;CAYf"}
@@ -33,6 +33,9 @@ class Integer {
33
33
  this.tex = tex || value + "";
34
34
  this.type = nombre_1.NumberType.Integer;
35
35
  }
36
+ equals(n) {
37
+ return this.value === n.value;
38
+ }
36
39
  toTree() {
37
40
  return new numberNode_1.NumberNode(this.value, this.tex);
38
41
  }
@@ -8,6 +8,7 @@ export declare class Power implements Nombre {
8
8
  operand: number;
9
9
  power: number;
10
10
  constructor(a: number, b: number);
11
+ equals(n: Nombre): boolean;
11
12
  simplify(): NumberNode | PowerNode;
12
13
  toDecimalWriting(): Nombre;
13
14
  toTree(): PowerNode;
@@ -1 +1 @@
1
- {"version":3,"file":"power.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/integer/power.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/C,qBAAa,KAAM,YAAW,MAAM;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBACF,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAOhC,QAAQ;IASR,gBAAgB,IAAI,MAAM;IAmB1B,MAAM;CAMP"}
1
+ {"version":3,"file":"power.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/integer/power.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/C,qBAAa,KAAM,YAAW,MAAM;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBACF,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAOhC,MAAM,CAAC,CAAC,EAAE,MAAM;IAGhB,QAAQ;IASR,gBAAgB,IAAI,MAAM;IAmB1B,MAAM;CAMP"}
@@ -13,6 +13,9 @@ class Power {
13
13
  this.tex = `${a}^{${b}}`;
14
14
  this.type = b < 0 ? nombre_1.NumberType.Rational : nombre_1.NumberType.Integer;
15
15
  }
16
+ equals(n) {
17
+ return this.value === n.value;
18
+ }
16
19
  simplify() {
17
20
  if (this.power === 0)
18
21
  return new numberNode_1.NumberNode(1);
@@ -6,6 +6,7 @@ export declare class Ln implements Nombre {
6
6
  type: NumberType;
7
7
  operand: Nombre;
8
8
  constructor(operand: Nombre);
9
+ equals(n: Nombre): boolean;
9
10
  toTree(): LogNode;
10
11
  simplify(): void;
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ln.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/logarithms/ln.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,qBAAa,EAAG,YAAW,MAAM;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;gBACJ,OAAO,EAAE,MAAM;IAM3B,MAAM;IAGN,QAAQ;CACT"}
1
+ {"version":3,"file":"ln.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/logarithms/ln.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,qBAAa,EAAG,YAAW,MAAM;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;gBACJ,OAAO,EAAE,MAAM;IAM3B,MAAM,CAAC,CAAC,EAAE,MAAM;IAGhB,MAAM;IAGN,QAAQ;CACT"}
@@ -10,6 +10,9 @@ class Ln {
10
10
  this.tex = `\\ln(${operand})`;
11
11
  this.operand = operand;
12
12
  }
13
+ equals(n) {
14
+ return this.value === n.value;
15
+ }
13
16
  toTree() {
14
17
  return new logNode_1.LogNode(this.operand.toTree());
15
18
  }
@@ -1,6 +1,5 @@
1
1
  import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
2
2
  import { NodeOptions } from "../../tree/nodes/node";
3
- import { Integer } from "./integer/integer";
4
3
  export declare enum NumberType {
5
4
  Integer = 0,
6
5
  Decimal = 1,
@@ -12,8 +11,12 @@ export interface Nombre {
12
11
  tex: string;
13
12
  type: NumberType;
14
13
  toTree: (opts?: NodeOptions) => AlgebraicNode;
14
+ equals: (n: Nombre) => boolean;
15
15
  }
16
16
  export declare abstract class NombreConstructor {
17
- static random(): import("./rationals/rational").Rational | Integer | import("./decimals/decimal").Decimal | import("./reals/real").Real;
17
+ static random({ types, excludes, }?: {
18
+ types?: NumberType[];
19
+ excludes?: Nombre[];
20
+ }): Nombre;
18
21
  }
19
22
  //# sourceMappingURL=nombre.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nombre.d.ts","sourceRoot":"","sources":["../../../src/math/numbers/nombre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAQ,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI5C,oBAAY,UAAU;IACpB,OAAO,IAAA;IACP,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,IAAI,IAAA;CACL;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,aAAa,CAAC;CAC/C;AAED,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM;CAkBd"}
1
+ {"version":3,"file":"nombre.d.ts","sourceRoot":"","sources":["../../../src/math/numbers/nombre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAQ,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAQ1D,oBAAY,UAAU;IACpB,OAAO,IAAA;IACP,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,IAAI,IAAA;CACL;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,aAAa,CAAC;IAC9C,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;CAChC;AAED,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM,CAAC,EACZ,KAAK,EACL,QAAQ,GACT,GAAE;QACD,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KAChB;CAiCP"}