math-exercises 3.0.21 → 3.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +2 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +60 -28
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +5 -3
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +5 -3
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.js +14 -3
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expFactorization.js +5 -2
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +30 -29
- package/lib/exercises/math/geometry/euclidian/index.d.ts +1 -1
- package/lib/exercises/math/geometry/euclidian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/index.js +1 -2
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts +9 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +205 -187
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +47 -16
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -3
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts +2 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts +11 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +141 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/index.js +1 -0
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +38 -26
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.d.ts +2 -0
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +6 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/segment.d.ts +6 -2
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +11 -6
- package/lib/math/geometry/spacePoint.d.ts +2 -1
- package/lib/math/geometry/spacePoint.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.js +16 -2
- package/lib/math/geometry/triangle.d.ts +2 -1
- package/lib/math/geometry/triangle.d.ts.map +1 -1
- package/lib/math/geometry/triangle.js +31 -13
- package/lib/math/spaceGeometry/prism.d.ts +4 -0
- package/lib/math/spaceGeometry/prism.d.ts.map +1 -0
- package/lib/math/spaceGeometry/prism.js +3 -0
- package/lib/tree/nodes/algebraicNode.d.ts +4 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +2 -2
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +4 -1
- package/lib/tree/nodes/functions/sinNode.d.ts +2 -2
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +4 -1
- package/lib/tree/nodes/functions/tanNode.d.ts +2 -2
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +4 -1
- package/package.json +1 -1
|
@@ -68,7 +68,10 @@ export class CosNode {
|
|
|
68
68
|
}
|
|
69
69
|
return new CosNode(simplifiedChild);
|
|
70
70
|
}
|
|
71
|
-
evaluate(vars) {
|
|
71
|
+
evaluate(vars, opts) {
|
|
72
|
+
if (opts?.degreeMode) {
|
|
73
|
+
return Math.cos((this.child.evaluate(vars, opts) * Math.PI) / 180);
|
|
74
|
+
}
|
|
72
75
|
return Math.cos(this.child.evaluate(vars));
|
|
73
76
|
}
|
|
74
77
|
equals(node) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node, NodeIds, NodeType } from "../node.js";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode.js";
|
|
3
|
-
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode.js";
|
|
3
|
+
import { AlgebraicNode, EvaluateOptions, SimplifyOptions } from "../algebraicNode.js";
|
|
4
4
|
export declare function isSinNode(a: Node): a is SinNode;
|
|
5
5
|
export declare const sin: (a: AlgebraicNode | number | string) => SinNode;
|
|
6
6
|
export declare class SinNode implements FunctionNode {
|
|
@@ -20,7 +20,7 @@ export declare class SinNode implements FunctionNode {
|
|
|
20
20
|
toEquivalentNodes(): AlgebraicNode[];
|
|
21
21
|
toAllValidTexs(): string[];
|
|
22
22
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
23
|
-
evaluate(vars?: Record<string, number
|
|
23
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
24
24
|
equals(node: AlgebraicNode): boolean;
|
|
25
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): SinNode;
|
|
26
26
|
derivative(varName?: string | undefined): AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAM7B,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AAED,eAAO,MAAM,GAAG,MAAO,aAAa,GAAG,MAAM,GAAG,MAAM,YAIrD,CAAC;AAEF,qBAAa,OAAQ,YAAW,YAAY;IAC1C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEP,KAAK,EAAE,aAAa;IAMhC,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAI1B,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,aAAa;IAwBnD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe;IAO9D,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -70,7 +70,10 @@ export class SinNode {
|
|
|
70
70
|
}
|
|
71
71
|
return new SinNode(simplifiedChild);
|
|
72
72
|
}
|
|
73
|
-
evaluate(vars) {
|
|
73
|
+
evaluate(vars, opts) {
|
|
74
|
+
if (opts?.degreeMode) {
|
|
75
|
+
return Math.sin((this.child.evaluate(vars, opts) * Math.PI) / 180);
|
|
76
|
+
}
|
|
74
77
|
return Math.sin(this.child.evaluate(vars));
|
|
75
78
|
}
|
|
76
79
|
equals(node) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node, NodeIds, NodeType } from "../node.js";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode.js";
|
|
3
|
-
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode.js";
|
|
3
|
+
import { AlgebraicNode, EvaluateOptions, SimplifyOptions } from "../algebraicNode.js";
|
|
4
4
|
export declare const tan: (a: AlgebraicNode | number | string) => TanNode;
|
|
5
5
|
export declare function isTanNode(a: Node): a is TanNode;
|
|
6
6
|
export declare class TanNode implements FunctionNode {
|
|
@@ -20,7 +20,7 @@ export declare class TanNode implements FunctionNode {
|
|
|
20
20
|
toEquivalentNodes(): AlgebraicNode[];
|
|
21
21
|
toAllValidTexs(): string[];
|
|
22
22
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
23
|
-
evaluate(vars?: Record<string, number
|
|
23
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
24
24
|
equals(node: AlgebraicNode): boolean;
|
|
25
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): TanNode;
|
|
26
26
|
derivative(varName?: string | undefined): AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/tanNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"tanNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/tanNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,GAAG,MAAO,aAAa,GAAG,MAAM,GAAG,MAAM,YAIrD,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AAED,qBAAa,OAAQ,YAAW,YAAY;IAC1C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEP,KAAK,EAAE,aAAa;IAMhC,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAI1B,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,aAAa;IAsBnD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe;IAO9D,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -65,7 +65,10 @@ export class TanNode {
|
|
|
65
65
|
}
|
|
66
66
|
return new TanNode(simplifiedChild);
|
|
67
67
|
}
|
|
68
|
-
evaluate(vars) {
|
|
68
|
+
evaluate(vars, opts) {
|
|
69
|
+
if (opts?.degreeMode) {
|
|
70
|
+
return Math.tan((this.child.evaluate(vars, opts) * Math.PI) / 180);
|
|
71
|
+
}
|
|
69
72
|
return Math.tan(this.child.evaluate(vars));
|
|
70
73
|
}
|
|
71
74
|
equals(node) {
|