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.
Files changed (68) hide show
  1. package/lib/exercises/math/dataRepresentations/barChartReading.d.ts.map +1 -1
  2. package/lib/exercises/math/dataRepresentations/barChartReading.js +0 -1
  3. package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts +9 -0
  4. package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -0
  5. package/lib/exercises/math/dataRepresentations/functionGraphReading.js +174 -0
  6. package/lib/exercises/math/dataRepresentations/index.js +1 -0
  7. package/lib/exercises/math/derivation/derivative/inflexionPointQuadrinomials.d.ts.map +1 -1
  8. package/lib/exercises/math/derivation/derivative/inflexionPointQuadrinomials.js +68 -14
  9. package/lib/exercises/math/functions/exponential/expFactorization.d.ts +13 -0
  10. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -0
  11. package/lib/exercises/math/functions/exponential/expFactorization.js +147 -0
  12. package/lib/exercises/math/functions/exponential/index.d.ts +1 -0
  13. package/lib/exercises/math/functions/exponential/index.d.ts.map +1 -1
  14. package/lib/exercises/math/functions/exponential/index.js +1 -0
  15. package/lib/exercises/math/geometry/angles/recognizeAngleType.js +1 -1
  16. package/lib/exercises/math/geometry/euclidian/index.js +1 -0
  17. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts +2 -0
  18. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -0
  19. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +187 -0
  20. package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -1
  21. package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +2 -1
  22. package/lib/exercises/math/geometry/index.d.ts +1 -0
  23. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  24. package/lib/exercises/math/geometry/index.js +2 -1
  25. package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
  26. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -0
  27. package/lib/exercises/math/geometry/lines/index.js +1 -0
  28. package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts +12 -0
  29. package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -0
  30. package/lib/exercises/math/geometry/lines/linesRelativePositions.js +140 -0
  31. package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +1 -1
  32. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +1 -1
  33. package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +2 -0
  34. package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
  35. package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +2 -1
  36. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts +6 -2
  37. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  38. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +99 -67
  39. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts +8 -0
  40. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts.map +1 -0
  41. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.js +147 -0
  42. package/lib/exercises/math/probaStat/basicStats/calculateFrequency.d.ts.map +1 -1
  43. package/lib/exercises/math/probaStat/basicStats/calculateFrequency.js +19 -10
  44. package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
  45. package/lib/geogebra/geogebraConstructor.js +12 -4
  46. package/lib/index.d.ts +25 -0
  47. package/lib/index.d.ts.map +1 -1
  48. package/lib/math/geometry/point.d.ts +2 -1
  49. package/lib/math/geometry/point.d.ts.map +1 -1
  50. package/lib/math/geometry/point.js +3 -3
  51. package/lib/math/geometry/triangle.d.ts +2 -7
  52. package/lib/math/geometry/triangle.d.ts.map +1 -1
  53. package/lib/math/geometry/triangle.js +7 -12
  54. package/lib/math/geometry/vector.d.ts +2 -0
  55. package/lib/math/geometry/vector.d.ts.map +1 -1
  56. package/lib/math/geometry/vector.js +3 -0
  57. package/lib/playground.d.ts.map +1 -1
  58. package/lib/playground.js +1 -3
  59. package/lib/tree/nodes/numbers/numberNode.d.ts +1 -0
  60. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  61. package/lib/tree/nodes/numbers/numberNode.js +3 -0
  62. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  63. package/lib/tree/nodes/operators/fractionNode.js +1 -1
  64. package/lib/tree/nodes/operators/scalarProductNode.d.ts +11 -0
  65. package/lib/tree/nodes/operators/scalarProductNode.d.ts.map +1 -0
  66. package/lib/tree/nodes/operators/scalarProductNode.js +16 -0
  67. package/lib/tree/parsers/powerParser.d.ts +1 -1
  68. package/package.json +2 -2
@@ -0,0 +1,187 @@
1
+ // import {
2
+ // Exercise,
3
+ // Proposition,
4
+ // QCMGenerator,
5
+ // Question,
6
+ // QuestionGenerator,
7
+ // VEA,
8
+ // GGBVEA,
9
+ // addValidProp,
10
+ // shuffleProps,
11
+ // tryToAddWrongProp,
12
+ // GetAnswer,
13
+ // GetHint,
14
+ // GetCorrection,
15
+ // GetInstruction,
16
+ // GetKeys,
17
+ // GetGGBOptions,
18
+ // GetStudentGGBOptions,
19
+ // GetGGBAnswer,
20
+ // } from "../../../../exercises/exercise.js";
21
+ // import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
22
+ // import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
23
+ // import { Line, LineConstructor } from "../../../../math/geometry/line.js";
24
+ // import {
25
+ // Point,
26
+ // PointConstructor,
27
+ // PointIdentifiers,
28
+ // } from "../../../../math/geometry/point.js";
29
+ // import {
30
+ // Segment,
31
+ // SegmentConstructor,
32
+ // SegmentIdentifiers,
33
+ // } from "../../../../math/geometry/segment.js";
34
+ // import {
35
+ // Triangle,
36
+ // TriangleConstructor,
37
+ // TriangleIdentifiers,
38
+ // } from "../../../../math/geometry/triangle.js";
39
+ // import { coinFlip } from "../../../../utils/alea/coinFlip.js";
40
+ export {};
41
+ // type Identifiers = {
42
+ // isAskingLength: boolean;
43
+ // triangleIdentifiers: TriangleIdentifiers;
44
+ // extraPoints: PointIdentifiers[];
45
+ // isSegmentHeight: boolean; // si hauteur alors configuration pythagore
46
+ // };
47
+ // const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
48
+ // const propositions: Proposition[] = [];
49
+ // addValidProp(propositions, answer, "raw");
50
+ // tryToAddWrongProp(propositions, "Le théorème de Thalès", "raw");
51
+ // tryToAddWrongProp(propositions, "La réciproque du théorème de Thalès", "raw");
52
+ // tryToAddWrongProp(propositions, "Le théorème de Pythagore", "raw");
53
+ // tryToAddWrongProp(
54
+ // propositions,
55
+ // "La réciproque du théorème de Pythagore",
56
+ // "raw",
57
+ // );
58
+ // return shuffleProps(propositions, n);
59
+ // };
60
+ // const getAnswer: GetAnswer<Identifiers> = (identifiers) => {
61
+ // const { isAskingLength, triangleIdentifiers, isSegmentHeight } = identifiers;
62
+ // return isSegmentHeight
63
+ // ? isAskingLength
64
+ // ? "Le théorème de Pythagore"
65
+ // : "La réciproque du théorème de Pythagore"
66
+ // : isAskingLength
67
+ // ? "Le théorème de Thalès"
68
+ // : "La réciproque du théorème de Thalès";
69
+ // };
70
+ // const getInstruction: GetInstruction<Identifiers> = (identifiers) => {
71
+ // const { isAskingLength, triangleIdentifiers, isSegmentHeight, extraPoints } = identifiers;
72
+ // const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
73
+ // const points = extraPoints.map((e) => PointConstructor.fromIdentifiers(e));
74
+ // let instruction = ``;
75
+ // if(isSegmentHeight){
76
+ // if(isAskingLength){
77
+ // instruction = `calculer la longueur $${triangle.sides[2].toInsideName()}$`
78
+ // } else {
79
+ // instruction = `prouver que le triangle $${triangle.points[1].name}${triangle.points[2].name}${points[0].name}$ est rectangle en $${points[0].name}$`
80
+ // }
81
+ // } else {
82
+ // if(isAskingLength){
83
+ // instruction = `calculer la longueur $${points[0].name}${points[1].name}$`
84
+ // } else {
85
+ // instruction = `prouver que les droites $${}$ et $${}$ sont parallèles`
86
+ // }
87
+ // }
88
+ // return `On donne la figure ci-dessous.
89
+ // Pour ${instruction}, il faut utiliser... `;
90
+ // };
91
+ // // const getHint: GetHint<Identifiers> = (identifiers) => {};
92
+ // // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
93
+ // const getGGBOptions: GetGGBOptions<Identifiers> = (identifiers) => {
94
+ // const { isAskingLength, triangleIdentifiers, extraPoints, isSegmentHeight } =
95
+ // identifiers;
96
+ // const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
97
+ // const points = extraPoints.map((e) => PointConstructor.fromIdentifiers(e));
98
+ // const commands = [
99
+ // ...triangle.commands,
100
+ // ...points.flatMap((p) => p.toGGBCommand()),
101
+ // ];
102
+ // if (isSegmentHeight) {
103
+ // commands.push(
104
+ // ...new Segment(triangle.points[1], points[0]).toGGBCommands(false),
105
+ // );
106
+ // } else {
107
+ // commands.push(...new Segment(points[0], points[1]).toGGBCommands(false));
108
+ // }
109
+ // const ggb = new GeogebraConstructor({
110
+ // commands,
111
+ // hideAxes: true,
112
+ // hideGrid: true,
113
+ // });
114
+ // return ggb.getOptions({
115
+ // coords: triangle.generateCoords(),
116
+ // });
117
+ // };
118
+ // const getKeys: GetKeys<Identifiers> = (identifiers) => {
119
+ // return [];
120
+ // };
121
+ // const isAnswerValid: VEA<Identifiers> = (ans, { answer }) => {
122
+ // throw Error("VEA not implemented");
123
+ // };
124
+ // const getPythagoreOrThalesQuestion: QuestionGenerator<Identifiers> = (opts) => {
125
+ // // const triangle = TriangleConstructor.randomNiceSides({});
126
+ // const A = new Point("A", 0, 0);
127
+ // const B = new Point("B", 4, 4);
128
+ // const C = new Point("C", 8, 0);
129
+ // const triangle = new Triangle([A, B, C]);
130
+ // const isSegmentHeight = coinFlip();
131
+ // const isAskingLength = coinFlip();
132
+ // let extraPoints: PointIdentifiers[] = [];
133
+ // if (isSegmentHeight) {
134
+ // const baseLine = LineConstructor.fromSegment(triangle.sides[1]);
135
+ // const height = baseLine.getPerpendicular(triangle.points[1]);
136
+ // extraPoints.push(height.intersect(baseLine, "H").toIdentifiers());
137
+ // } else {
138
+ // const baseLine = LineConstructor.fromSegment(triangle.sides[1]);
139
+ // const D = PointConstructor.onSegment(triangle.sides[2], "D", {
140
+ // spacing: 0.3,
141
+ // });
142
+ // const para = baseLine.getParallele(D);
143
+ // const E = para.intersect(
144
+ // LineConstructor.fromSegment(triangle.sides[0]),
145
+ // "E",
146
+ // );
147
+ // extraPoints.push(D.toIdentifiers());
148
+ // extraPoints.push(E.toIdentifiers());
149
+ // }
150
+ // const identifiers: Identifiers = {
151
+ // triangleIdentifiers: triangle.toIdentifiers(),
152
+ // // segmentIdentifiers: triangle.sides[0].toIdentifiers(),
153
+ // extraPoints,
154
+ // isAskingLength,
155
+ // isSegmentHeight,
156
+ // };
157
+ // const question: Question<Identifiers> = {
158
+ // answer: getAnswer(identifiers),
159
+ // instruction: getInstruction(identifiers),
160
+ // keys: getKeys(identifiers),
161
+ // answerFormat: "raw",
162
+ // identifiers,
163
+ // // hint: getHint(identifiers),
164
+ // // correction: getCorrection(identifiers),
165
+ // ggbOptions: getGGBOptions(identifiers),
166
+ // };
167
+ // return question;
168
+ // };
169
+ // export const pythagoreOrThales: Exercise<Identifiers> = {
170
+ // id: "pythagoreOrThales",
171
+ // label: "",
172
+ // isSingleStep: true,
173
+ // generator: (nb, opts) =>
174
+ // getDistinctQuestions(() => getPythagoreOrThalesQuestion(opts), nb),
175
+ // qcmTimer: 60,
176
+ // freeTimer: 60,
177
+ // getPropositions,
178
+ // isAnswerValid,
179
+ // subject: "Mathématiques",
180
+ // // getHint,
181
+ // // getCorrection,
182
+ // getInstruction,
183
+ // getAnswer,
184
+ // getGGBOptions,
185
+ // hasGeogebra: true,
186
+ // answerType: "QCU",
187
+ // };
@@ -1 +1 @@
1
- {"version":3,"file":"buildPointFromAxialSymetry.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAiGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAe5D,CAAC"}
1
+ {"version":3,"file":"buildPointFromAxialSymetry.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAEtC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAkGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAe5D,CAAC"}
@@ -26,7 +26,7 @@ const getGGBAnswer = (identifiers) => {
26
26
  const circle = new Circle(center, point, "C");
27
27
  return [
28
28
  ...sol.toGGBCommand(),
29
- ...perp.toGGBCommands(false),
29
+ ...perp.toGGBCommands(false, { color: "black" }),
30
30
  ...circle.toGGBCommands(false),
31
31
  ];
32
32
  };
@@ -37,6 +37,7 @@ const getStudentGGBOptions = (identifiers) => {
37
37
  ...point.toGGBCommand(),
38
38
  ...line.toGGBCommands(false, {
39
39
  showLabel: true,
40
+ color: "black",
40
41
  }),
41
42
  ];
42
43
  const sol = getSolutionPoint(identifiers);
@@ -11,4 +11,5 @@ export * from "./shapes/index.js";
11
11
  export * from "./parametric/index.js";
12
12
  export * from "./quadrilaterals/index.js";
13
13
  export * from "./angles/index.js";
14
+ export * from "./lines/index.js";
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAElC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAElC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
@@ -9,7 +9,8 @@ export * from "./volumes/index.js";
9
9
  // export * from "./triangles.js";
10
10
  export * from "./euclidianConstructions/index.js";
11
11
  export * from "./shapes/index.js";
12
- // export * from "./euclidian.js";
12
+ // export * from "./euclidian/index.js";
13
13
  export * from "./parametric/index.js";
14
14
  export * from "./quadrilaterals/index.js";
15
15
  export * from "./angles/index.js";
16
+ export * from "./lines/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./linesRelativePositions.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./linesRelativePositions.js";
@@ -0,0 +1,12 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ lines: {
4
+ pointA: number[];
5
+ pointB: number[];
6
+ label: string;
7
+ }[];
8
+ coupleAsked: number;
9
+ };
10
+ export declare const linesRelativePositions: Exercise<Identifiers>;
11
+ export {};
12
+ //# sourceMappingURL=linesRelativePositions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE/D,WAAW,EAAE,MAAM,CAAC;CAKrB,CAAC;AA+IF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAmBxD,CAAC"}
@@ -0,0 +1,140 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
+ import { Line } from "../../../../math/geometry/line.js";
5
+ import { Point } from "../../../../math/geometry/point.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ const getPropositions = (n, { answer, coupleAsked, lines }) => {
8
+ const propositions = [];
9
+ addValidProp(propositions, answer, "raw");
10
+ tryToAddWrongProp(propositions, "perpendiculaires", "raw");
11
+ tryToAddWrongProp(propositions, "parallèles", "raw");
12
+ tryToAddWrongProp(propositions, "sécantes mais non perpendiculaires", "raw");
13
+ return shuffleProps(propositions, n);
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const { coupleAsked, lines } = identifiers;
17
+ switch (coupleAsked) {
18
+ case 0:
19
+ return `perpendiculaires`;
20
+ case 1:
21
+ return "parallèles";
22
+ case 2:
23
+ case 3:
24
+ default:
25
+ return "sécantes mais non perpendiculaires";
26
+ }
27
+ };
28
+ const getInstruction = (identifiers) => {
29
+ const { coupleAsked, lines } = identifiers;
30
+ const askedLines = coupleAsked === 0
31
+ ? [lines[0], lines[4]]
32
+ : coupleAsked === 3
33
+ ? [lines[2], lines[4]]
34
+ : [lines[coupleAsked], lines[coupleAsked + 1]];
35
+ return `On donne la figure ci-dessous.
36
+
37
+ $${askedLines[0].label}$ et $${askedLines[1].label}$ semblent...`;
38
+ };
39
+ // const getHint: GetHint<Identifiers> = (identifiers) => {};
40
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
41
+ const getGGBOptions = (identifiers) => {
42
+ const lines = identifiers.lines.map((d, i) => new Line(new Point(`A_${d.label}`, d.pointA[0], d.pointA[1]), new Point(`B_${d.label}`, d.pointB[0], d.pointB[1]), d.label));
43
+ const ggb = new GeogebraConstructor({
44
+ commands: lines.flatMap((l) => l.toGGBCommands(false, { showLabel: true, color: "black" })),
45
+ forbidShiftDragZoom: true,
46
+ hideAxes: true,
47
+ hideGrid: true,
48
+ });
49
+ return ggb.getOptions({
50
+ coords: [-3, 5, -2, 6],
51
+ });
52
+ };
53
+ const getKeys = (identifiers) => {
54
+ return [];
55
+ };
56
+ const isAnswerValid = (ans, { answer }) => {
57
+ throw Error("VEA not implemented");
58
+ };
59
+ const getLinesRelativePositionsQuestion = (opts) => {
60
+ // const permut = shuffle([1, 2, 3, 4, 5]);
61
+ const permut = [1, 2, 3, 4, 5];
62
+ // const v2 = VectorConstructor.random("v2", false);
63
+ // const v3 = v2;
64
+ // let v1: Vector;
65
+ // let v4: Vector;
66
+ // let v5: Vector;
67
+ // do {
68
+ // v1 = VectorConstructor.random("v1", false);
69
+ // } while (Math.abs(v1.determinant(v2).evaluate()) < 2);
70
+ // v5 = v1.getOrthogonal();
71
+ // // do {
72
+ // v4 = VectorConstructor.random("v4", false);
73
+ // console.log("iter");
74
+ // } while (
75
+ // Math.abs(v4.determinant(v3).evaluate()) > 10 ||
76
+ // Math.abs(v4.determinant(v3).evaluate()) < 1
77
+ // );
78
+ // console.log("det", Math.abs(v4.determinant(v3).evaluate()));
79
+ // let pointA = [randint(-9, 10), randint(-9, 10)];
80
+ // let B = v1.getEndPoint(new Point("A", pointA[0], pointA[1]));
81
+ // let pointB = [B.x.evaluate(), B.y.evaluate()];
82
+ const d1 = {
83
+ label: `d_{${permut[0]}}`,
84
+ pointA: [-2, 5],
85
+ pointB: [-1, 4],
86
+ };
87
+ const d2 = {
88
+ label: `d_{${permut[1]}}`,
89
+ pointA: [1, 6],
90
+ pointB: [0, 3],
91
+ };
92
+ const d3 = {
93
+ label: `d_{${permut[2]}}`,
94
+ pointA: [2, 5],
95
+ pointB: [1, 2],
96
+ };
97
+ const d4 = {
98
+ label: `d_{${permut[3]}}`,
99
+ pointA: [6, 7],
100
+ pointB: [3, 1],
101
+ };
102
+ const d5 = {
103
+ label: `d_{${permut[4]}}`,
104
+ pointA: [0, 1],
105
+ pointB: [1, 2],
106
+ };
107
+ const lines = [d1, d2, d3, d4, d5];
108
+ const coupleAsked = randint(0, 4);
109
+ const identifiers = { lines, coupleAsked };
110
+ const question = {
111
+ answer: getAnswer(identifiers),
112
+ instruction: getInstruction(identifiers),
113
+ keys: getKeys(identifiers),
114
+ answerFormat: "raw",
115
+ identifiers,
116
+ // hint: getHint(identifiers),
117
+ // correction: getCorrection(identifiers),
118
+ ggbOptions: getGGBOptions(identifiers),
119
+ };
120
+ return question;
121
+ };
122
+ export const linesRelativePositions = {
123
+ id: "linesRelativePositions",
124
+ label: "Déterminer la position relative de deux droites",
125
+ isSingleStep: true,
126
+ generator: (nb, opts) => getDistinctQuestions(() => getLinesRelativePositionsQuestion(opts), nb, 4),
127
+ qcmTimer: 60,
128
+ freeTimer: 60,
129
+ getPropositions,
130
+ isAnswerValid,
131
+ subject: "Mathématiques",
132
+ // getHint,
133
+ // getCorrection,
134
+ getInstruction,
135
+ getAnswer,
136
+ getGGBOptions,
137
+ hasGeogebra: true,
138
+ maxAllowedQuestions: 4,
139
+ answerType: "QCU",
140
+ };
@@ -29,7 +29,7 @@ const getBasicShapesNamingQuestion = () => {
29
29
  case 3: //droite
30
30
  default:
31
31
  const line = LineConstructor.random();
32
- commands.push(...line.toGGBCommands(true));
32
+ commands.push(...line.toGGBCommands(true, { color: "black" }));
33
33
  answer = line.toTexNoLeftRight();
34
34
  break;
35
35
  }
@@ -31,7 +31,7 @@ const getBasicShapesRecognitionQuestion = () => {
31
31
  default:
32
32
  answer = "Une droite";
33
33
  const line = LineConstructor.random();
34
- commands.push(...line.toGGBCommands(true));
34
+ commands.push(...line.toGGBCommands(true, { color: "black" }));
35
35
  break;
36
36
  }
37
37
  const ggb = new GeogebraConstructor({
@@ -1,3 +1,5 @@
1
1
  export * from "./scalarProductViaCoords.js";
2
2
  export * from "./scalarProductViaCos.js";
3
+ export * from "./scalarProductOrthoInSquare.js";
4
+ export * from "./scalarProductViaNorms.js";
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from "./scalarProductViaCoords.js";
2
2
  export * from "./scalarProductViaCos.js";
3
- // export * from "./scalarProductOrthoInSquare.js";
3
+ export * from "./scalarProductOrthoInSquare.js";
4
+ export * from "./scalarProductViaNorms.js";
@@ -1,8 +1,12 @@
1
1
  import { Exercise } from "../../../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
3
  c: number;
4
- vector1Name: string;
5
- vector2Name: string;
4
+ vec1Name: string;
5
+ vec2Name: string;
6
+ areSameDirection: boolean;
7
+ vec1ProjLength: number;
8
+ vec2ProjLength: number;
9
+ rotationAngle: number;
6
10
  };
7
11
  export declare const scalarProductOrthoInSquare: Exercise<Identifiers>;
8
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA4HF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
1
+ {"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAgKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}