math-exercises 2.1.26-beta.2 → 2.1.26-beta.3

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.
@@ -0,0 +1,12 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ moleculeName: string;
4
+ concentration: number;
5
+ molarAbsorptivity: number;
6
+ pathLength: number;
7
+ absorbance: number;
8
+ randomIndex: number;
9
+ };
10
+ export declare const BeerLambertRandomValueExercise: Exercise<Identifiers>;
11
+ export {};
12
+ //# sourceMappingURL=beerLambertRandomValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beerLambertRandomValue.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/beerLambertRandomValue.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAmJF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAahE,CAAC"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BeerLambertRandomValueExercise = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const round_1 = require("../../../math/utils/round");
7
+ const molecule_1 = require("../../../pc/molecularChemistry/molecule");
8
+ const random_1 = require("../../../utils/random");
9
+ const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
10
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
11
+ const randint_1 = require("../../../math/utils/random/randint");
12
+ const getBeerLambertRandomValueQuestion = () => {
13
+ const molecule = (0, random_1.random)(molecule_1.molecules);
14
+ const concentration = (0, round_1.round)((0, randfloat_1.randfloat)(0.01, 0.1), 2); // Concentration in mol/L
15
+ const molarAbsorptivity = (0, round_1.round)((0, randfloat_1.randfloat)(10, 100), 1); // Molar absorptivity in L/(mol·cm)
16
+ const pathLength = (0, round_1.round)((0, randfloat_1.randfloat)(1, 5), 1); // Path length in cm
17
+ const absorbance = (0, round_1.round)(concentration * molarAbsorptivity * pathLength, 2); // Absorbance
18
+ const variables = [
19
+ { name: "concentration", value: concentration, unit: "mol/L" },
20
+ { name: "molarAbsorptivity", value: molarAbsorptivity, unit: "L/(mol·cm)" },
21
+ { name: "pathLength", value: pathLength, unit: "cm" },
22
+ { name: "absorbance", value: absorbance, unit: "" },
23
+ ];
24
+ const randomIndex = (0, randint_1.randint)(0, variables.length - 1);
25
+ const targetVariable = variables[randomIndex];
26
+ const knownVariables = variables.filter((_, index) => index !== randomIndex);
27
+ const knownVariablesText = knownVariables
28
+ .map((v) => `${v.name === "concentration"
29
+ ? "Concentration"
30
+ : v.name === "molarAbsorptivity"
31
+ ? "Coefficient d'absorption molaire"
32
+ : v.name === "pathLength"
33
+ ? "Longueur du trajet optique"
34
+ : "Absorbance"} : ${v.name === "concentration"
35
+ ? "$C$"
36
+ : v.name === "molarAbsorptivity"
37
+ ? "$ε$"
38
+ : v.name === "pathLength"
39
+ ? "$\\ell$"
40
+ : "$A$"} = $${v.value}\\ ${v.unit}$`)
41
+ .join(",\n");
42
+ const instruction = `Vous êtes en train de réaliser l'étalonnage d'une solution ${(0, requiresApostropheBefore_1.requiresApostropheBefore)(molecule.name) ? "d'" : "de "}${molecule.name} en utilisant une solution étalon. Vous avez mesuré les données suivantes :\n
43
+ - ${knownVariablesText}.\n
44
+ À partir de ces données, déterminez la ${targetVariable.name === "concentration"
45
+ ? "concentration en mol/L"
46
+ : targetVariable.name === "molarAbsorptivity"
47
+ ? "coefficient d'absorption molaire en L/(mol·cm)"
48
+ : targetVariable.name === "pathLength"
49
+ ? "longueur du trajet optique en cm"
50
+ : "absorbance"} de cette solution.`;
51
+ const hint = `Rappelez-vous la loi de Beer-Lambert : $A = ε \\cdot C \\cdot \\ell$.
52
+ Réorganisez cette formule pour isoler la variable à trouver.`;
53
+ const correction = `La loi de Beer-Lambert est donnée par :
54
+ $A = ε \\cdot \\ell \\cdot C$. En utilisant les valeurs fournies pour $ε$, $C$, et $\\ell$, vous pouvez résoudre pour la variable manquante.
55
+ Si $A$ est l'absorbance, $ε$ est le coefficient d'absorption molaire, $C$ est la concentration et $\\ell$ est la longueur du trajet optique, alors
56
+ ${targetVariable.name === "concentration"
57
+ ? "$C = \\frac{A}{ε \\cdot \\ell}$"
58
+ : ""}
59
+ ${targetVariable.name === "molarAbsorptivity"
60
+ ? "$ε = \\frac{A}{C \\cdot \\ell}$"
61
+ : ""}
62
+ ${targetVariable.name === "pathLength"
63
+ ? "$\\ell = \\frac{A}{ε \\cdot C}$"
64
+ : ""}
65
+ ${targetVariable.name === "absorbance" ? "$A = ε \\cdot C \\cdot \\ell$" : ""}`;
66
+ const question = {
67
+ answer: targetVariable.value.toTree().toTex(),
68
+ instruction,
69
+ hint,
70
+ correction,
71
+ keys: [],
72
+ answerFormat: "tex",
73
+ identifiers: {
74
+ moleculeName: molecule.name,
75
+ concentration,
76
+ molarAbsorptivity,
77
+ pathLength,
78
+ absorbance,
79
+ randomIndex,
80
+ },
81
+ };
82
+ return question;
83
+ };
84
+ const getPropositions = (n, { answer, concentration, molarAbsorptivity, pathLength, absorbance }) => {
85
+ const propositions = [];
86
+ (0, exercise_1.addValidProp)(propositions, answer);
87
+ (0, exercise_1.tryToAddWrongProp)(propositions, concentration.toTree().toTex());
88
+ (0, exercise_1.tryToAddWrongProp)(propositions, molarAbsorptivity.toTree().toTex());
89
+ (0, exercise_1.tryToAddWrongProp)(propositions, pathLength.toTree().toTex());
90
+ (0, exercise_1.tryToAddWrongProp)(propositions, absorbance.toTree().toTex());
91
+ while (propositions.length < n) {
92
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(0, 10, 2).toTree().toTex());
93
+ }
94
+ return (0, exercise_1.shuffleProps)(propositions, n);
95
+ };
96
+ const isAnswerValid = (ans, { answer, randomIndex, concentration, molarAbsorptivity, pathLength, absorbance, }) => {
97
+ const variables = [
98
+ { name: "concentration", value: concentration, unit: "mol/L" },
99
+ { name: "molarAbsorptivity", value: molarAbsorptivity, unit: "L/(mol·cm)" },
100
+ { name: "pathLength", value: pathLength, unit: "cm" },
101
+ { name: "absorbance", value: absorbance, unit: "" },
102
+ ];
103
+ const validAnswer = variables[randomIndex].value;
104
+ const latexs = validAnswer.toTree().toAllValidTexs();
105
+ return latexs.includes(ans);
106
+ };
107
+ exports.BeerLambertRandomValueExercise = {
108
+ id: "beerLambertRandomValue",
109
+ label: "Utiliser la loi de Beer-Lambert",
110
+ levels: ["1reSpé"],
111
+ isSingleStep: true,
112
+ sections: ["Spectrophotométrie"],
113
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBeerLambertRandomValueQuestion, nb),
114
+ qcmTimer: 60,
115
+ freeTimer: 60,
116
+ getPropositions,
117
+ isAnswerValid,
118
+ subject: "Chimie",
119
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./beerLambertRandomValue";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./beerLambertRandomValue"), exports);
@@ -22,6 +22,8 @@ export * from "./mecanicalWaves";
22
22
  export * from "./fluids";
23
23
  export * from "./electricity";
24
24
  export * from "./calibrationCurveOfSolution";
25
+ export * from "./dosage";
26
+ export * from "./spectral";
25
27
  /**exos pris des maths */
26
28
  export * from "../math/percent/findProportion";
27
29
  export * from "../math/calcul/proportionality/proportionalityTable";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,MAAM,CAAC;AACrB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAE7C,yBAAyB;AACzB,cAA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,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAC9F,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC"}
@@ -39,6 +39,8 @@ __exportStar(require("./mecanicalWaves"), exports);
39
39
  __exportStar(require("./fluids"), exports);
40
40
  __exportStar(require("./electricity"), exports);
41
41
  __exportStar(require("./calibrationCurveOfSolution"), exports);
42
+ __exportStar(require("./dosage"), exports);
43
+ __exportStar(require("./spectral"), exports);
42
44
  /**exos pris des maths */
43
45
  __exportStar(require("../math/percent/findProportion"), exports);
44
46
  __exportStar(require("../math/calcul/proportionality/proportionalityTable"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./spectralEnergy";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/spectral/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./spectralEnergy"), exports);
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ import { Measure } from "../../../pc/measure/measure";
3
+ type Identifiers = {
4
+ wavelengths: Measure[];
5
+ targetColor: "bleue" | "verte" | "rouge";
6
+ energy: Measure;
7
+ };
8
+ export declare const SpectralEnergyExercise: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=spectralEnergy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spectralEnergy.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/spectral/spectralEnergy.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAKnD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,EAAE,CAAC;IACvB,WAAW,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IACzC,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AA0IF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpectralEnergyExercise = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const measure_1 = require("../../../pc/measure/measure");
7
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
8
+ const randint_1 = require("../../../math/utils/random/randint");
9
+ const quantic_1 = require("../../../pc/constants/quantic");
10
+ const wavelengths = {
11
+ bleue: { min: 400, max: 455 },
12
+ verte: { min: 500, max: 560 },
13
+ rouge: { min: 610, max: 660 },
14
+ };
15
+ const h = new measure_1.Measure(quantic_1.planckConstant.value.significantPart, quantic_1.planckConstant.value.exponent);
16
+ const c = new measure_1.Measure(quantic_1.lightSpeed.value.significantPart, quantic_1.lightSpeed.value.exponent);
17
+ const images = [
18
+ `https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum1.png`,
19
+ `https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum2.png`,
20
+ `https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum3.png`,
21
+ `https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum4.png`,
22
+ `https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum5.png`,
23
+ ];
24
+ const getSpectralEnergyQuestion = () => {
25
+ const wavelengthBlueNm = (0, randint_1.randint)(wavelengths.bleue.min, wavelengths.bleue.max);
26
+ const wavelengthGreenNm = (0, randint_1.randint)(wavelengths.verte.min, wavelengths.verte.max);
27
+ const wavelengthRedNm = (0, randint_1.randint)(wavelengths.rouge.min, wavelengths.rouge.max);
28
+ const wavelengthBlue = new measure_1.Measure(wavelengthBlueNm, -9);
29
+ const wavelengthGreen = new measure_1.Measure(wavelengthGreenNm, -9);
30
+ const wavelengthRed = new measure_1.Measure(wavelengthRedNm, -9);
31
+ const energies = {
32
+ bleue: h.times(c).divide(wavelengthBlue).toSignificant(2),
33
+ verte: h.times(c).divide(wavelengthGreen).toSignificant(2),
34
+ rouge: h.times(c).divide(wavelengthRed).toSignificant(2),
35
+ };
36
+ const colors = ["bleue", "verte", "rouge"];
37
+ const targetColor = colors[(0, randint_1.randint)(0, colors.length - 1)];
38
+ const targetEnergy = energies[targetColor];
39
+ const instruction = `Vous travaillez dans un laboratoire de spectroscopie et vous êtes en train de réaliser une analyse des transitions électroniques d'un échantillon. \n
40
+ Vous avez utilisé un spectromètre pour mesurer les longueurs d'onde des raies d'émission de la lumière émise par l'échantillon. \n
41
+ Les mesures que vous avez obtenues sont les suivantes :
42
+ - Longueur d'onde de la lumière bleue : $\\lambda_{bleue} = ${wavelengthBlueNm}\\ nm$,
43
+ - Longueur d'onde de la lumière verte : $\\lambda_{verte} = ${wavelengthGreenNm}\\ nm$,
44
+ - Longueur d'onde de la lumière rouge : $\\lambda_{rouge} = ${wavelengthRedNm}\\ nm$.
45
+ ![](${images[(0, randint_1.randint)(0, images.length)]})
46
+ En utilisant ces données, calculez l'énergie de transition en joules pour la lumière ${targetColor} émise par l'échantillon.`;
47
+ const hint = `Rappelez-vous la relation entre l'énergie et la longueur d'onde : $E = \\frac{hc}{\\lambda}$. Rappel des constantes :
48
+ - Constante de Planck : $h = ${h.toSignificant(2).toTex()}$
49
+ - Vitesse de la lumière : $c = ${c.toSignificant(2).toTex()}$`;
50
+ const correction = `La relation entre l'énergie et la longueur d'onde est donnée par :
51
+ $E = \\frac{hc}{\\lambda}$. En utilisant les valeurs fournies pour $h$, $c$, et $\\lambda_{${targetColor}}$ (en mètres), vous pouvez résoudre pour l'énergie :
52
+ $E_{${targetColor}} = \\frac{${h.toTex({ scientific: 2 })} \\times ${c.toTex({
53
+ scientific: 2,
54
+ })}}{${targetColor === "bleue"
55
+ ? wavelengthBlue.toTex({
56
+ scientific: 2,
57
+ })
58
+ : targetColor === "rouge"
59
+ ? wavelengthRed.toTex({ scientific: 2 })
60
+ : wavelengthGreen.toTex({ scientific: 2 })}} = ${targetEnergy.toTex()}\\ J$.`;
61
+ const question = {
62
+ answer: targetEnergy.toTex(),
63
+ instruction,
64
+ hint,
65
+ correction,
66
+ keys: [],
67
+ answerFormat: "tex",
68
+ identifiers: {
69
+ wavelengths: [wavelengthBlue, wavelengthGreen, wavelengthRed],
70
+ targetColor,
71
+ energy: targetEnergy,
72
+ },
73
+ };
74
+ return question;
75
+ };
76
+ const getPropositions = (n, { answer, energy }) => {
77
+ const propositions = [];
78
+ (0, exercise_1.addValidProp)(propositions, answer);
79
+ const incorrectValues = [
80
+ new measure_1.Measure((0, randfloat_1.randfloat)(0.1, 10, 2), -19).toSignificant(2),
81
+ energy.times(new measure_1.Measure(1, -8)),
82
+ energy.times(new measure_1.Measure(1, 34)),
83
+ ];
84
+ incorrectValues.forEach((value) => {
85
+ (0, exercise_1.tryToAddWrongProp)(propositions, value.toTex());
86
+ });
87
+ while (propositions.length < n) {
88
+ (0, exercise_1.tryToAddWrongProp)(propositions, new measure_1.Measure((0, randfloat_1.randfloat)(0.1, 10, 2), -19).toSignificant(2).toTex());
89
+ }
90
+ return (0, exercise_1.shuffleProps)(propositions, n);
91
+ };
92
+ const isAnswerValid = (ans, { answer, energy, wavelengths, targetColor }) => {
93
+ const energies = {
94
+ bleue: h.times(c).divide(wavelengths[0]),
95
+ verte: h.times(c).divide(wavelengths[1]),
96
+ rouge: h.times(c).divide(wavelengths[2]),
97
+ };
98
+ const targetEnergy = energies[targetColor];
99
+ const validAnswer1 = targetEnergy.toSignificant(1).toTex();
100
+ const validAnswer2 = targetEnergy.toSignificant(2).toTex();
101
+ const validAnswer3 = targetEnergy.toSignificant(3).toTex();
102
+ let latexs = [];
103
+ latexs.push(validAnswer1, validAnswer2, validAnswer3);
104
+ return latexs.includes(ans);
105
+ };
106
+ exports.SpectralEnergyExercise = {
107
+ id: "spectralEnergy",
108
+ label: "Calculer l'énergie d'une lumière à partir de la longueur d'onde",
109
+ levels: ["TermSpé"],
110
+ isSingleStep: true,
111
+ sections: ["Quantique"],
112
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSpectralEnergyQuestion, nb),
113
+ qcmTimer: 60,
114
+ freeTimer: 60,
115
+ getPropositions,
116
+ isAnswerValid,
117
+ subject: "Physique",
118
+ };
package/lib/index.d.ts CHANGED
@@ -1617,6 +1617,17 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1617
1617
  }> | import("./exercises/exercise").Exercise<{
1618
1618
  epsilon: number;
1619
1619
  l: number;
1620
+ }> | import("./exercises/exercise").Exercise<{
1621
+ moleculeName: string;
1622
+ concentration: number;
1623
+ molarAbsorptivity: number;
1624
+ pathLength: number;
1625
+ absorbance: number;
1626
+ randomIndex: number;
1627
+ }> | import("./exercises/exercise").Exercise<{
1628
+ wavelengths: import("./pc/measure/measure").Measure[];
1629
+ targetColor: "rouge" | "verte" | "bleue";
1630
+ energy: import("./pc/measure/measure").Measure;
1620
1631
  }>)[];
1621
1632
  export { mathExercises, pcExercises };
1622
1633
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;CACF;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BE;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAjCnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Measure } from "../measure/measure";
2
+ type PhysicalConstant = {
3
+ value: Measure;
4
+ unit: string;
5
+ };
6
+ export declare const planckConstant: PhysicalConstant;
7
+ export declare const lightSpeed: PhysicalConstant;
8
+ export {};
9
+ //# sourceMappingURL=quantic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quantic.d.ts","sourceRoot":"","sources":["../../../src/pc/constants/quantic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAI5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,gBAIxB,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lightSpeed = exports.planckConstant = void 0;
4
+ const measure_1 = require("../measure/measure");
5
+ exports.planckConstant = {
6
+ value: new measure_1.Measure(6.626, -34),
7
+ // value: 6.626 * Math.pow(10, -34),
8
+ unit: "\\text{J.s}",
9
+ };
10
+ exports.lightSpeed = {
11
+ value: new measure_1.Measure(3, 8),
12
+ // value: 3 * Math.pow(10, 8),
13
+ unit: "\\text{m.s^(-1)}",
14
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.1.26-beta.2",
3
+ "version": "2.1.26-beta.3",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [