math-exercises 3.0.48 → 3.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/addAndSub.d.ts +7 -1
- package/lib/exercises/math/calcul/addAndSub.d.ts.map +1 -1
- package/lib/exercises/math/calcul/addAndSub.js +26 -14
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.js +0 -2
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +6 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +33 -3
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/index.js +1 -0
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/index.js +2 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateVariable.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateVariable.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateVariable.js +83 -0
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +1 -1
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +0 -1
- package/lib/exercises/math/functions/affines/index.d.ts +0 -1
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +0 -1
- package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunction.js +16 -3
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +10 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.js +31 -16
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +50 -14
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts +1 -0
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +48 -40
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts +10 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +171 -0
- package/lib/exercises/math/geometry/lines/findPointOnLineWithCartesianEquation.d.ts +9 -0
- package/lib/exercises/math/geometry/lines/findPointOnLineWithCartesianEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/findPointOnLineWithCartesianEquation.js +146 -0
- package/lib/exercises/math/geometry/lines/findPointOnLineWithReductEquation.d.ts +8 -0
- package/lib/exercises/math/geometry/lines/findPointOnLineWithReductEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/findPointOnLineWithReductEquation.js +99 -0
- package/lib/exercises/math/geometry/lines/index.d.ts +5 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +5 -0
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts +13 -0
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +118 -0
- package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts +11 -0
- package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/isPointOnLine.js +94 -0
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.js +0 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +93 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.js +111 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductIdentities.d.ts +10 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductIdentities.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductIdentities.js +174 -0
- package/lib/exercises/math/geometry/vectors/vectorLinearCombination.js +2 -2
- package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/constantPrimitive.js +22 -5
- package/lib/exercises/math/primitive/expUPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/expUPrimitive.js +25 -7
- package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/exponentialPrimitive.js +23 -5
- package/lib/exercises/math/primitive/index.d.ts +2 -0
- package/lib/exercises/math/primitive/index.d.ts.map +1 -1
- package/lib/exercises/math/primitive/index.js +2 -0
- package/lib/exercises/math/primitive/kexpUPrimitive.d.ts +9 -0
- package/lib/exercises/math/primitive/kexpUPrimitive.d.ts.map +1 -0
- package/lib/exercises/math/primitive/kexpUPrimitive.js +130 -0
- package/lib/exercises/math/primitive/klogUPrimitive.d.ts +9 -0
- package/lib/exercises/math/primitive/klogUPrimitive.d.ts.map +1 -0
- package/lib/exercises/math/primitive/klogUPrimitive.js +120 -0
- package/lib/exercises/math/primitive/logarithmePrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/logarithmePrimitive.js +30 -18
- package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +0 -11
- package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/sinUCosUPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/sinUCosUPrimitive.js +33 -18
- package/lib/exercises/math/probaStat/ballsBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/ballsBasicProbas.js +28 -4
- package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueList.js +46 -14
- package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts.map +1 -1
- package/lib/index.d.ts +45 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/spaceVector.d.ts +1 -2
- package/lib/math/geometry/spaceVector.d.ts.map +1 -1
- package/lib/math/geometry/vector.d.ts +8 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +12 -1
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/integer/integer.d.ts.map +1 -1
- package/lib/math/numbers/integer/power.d.ts.map +1 -1
- package/lib/math/numbers/nombre.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/sequences/geometricSequence.js +2 -2
- package/lib/math/sequences/sequence.d.ts +3 -3
- package/lib/math/sequences/sequence.d.ts.map +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +4 -6
- package/lib/prototypesEnhancement.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +0 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +14 -8
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +119 -6
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +8 -2
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +14 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts +7 -1
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/multiEqualNode.js +14 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +4 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +8 -3
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +14 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +8 -2
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +14 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +8 -2
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +14 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +8 -3
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +14 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +8 -2
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +14 -0
- package/lib/tree/nodes/node.d.ts +1 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +4 -1
- package/lib/tree/nodes/numbers/percentNode.d.ts +10 -3
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +17 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +14 -25
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -1
- package/lib/tree/nodes/operators/scalarProductNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/monomNode.js +1 -2
- package/lib/tree/nodes/sets/belongsNode.d.ts +11 -5
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.js +14 -0
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +0 -1
- package/lib/tree/parsers/equationSolutionParser.d.ts +1 -1
- package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
- package/lib/tree/parsers/pointParser.d.ts +3 -0
- package/lib/tree/parsers/pointParser.d.ts.map +1 -0
- package/lib/tree/parsers/pointParser.js +13 -0
- package/lib/tree/parsers/spacePointParser.d.ts.map +1 -1
- package/lib/tree/parsers/spacePointParser.js +2 -0
- package/lib/tree/parsers/vectorParser.d.ts +3 -0
- package/lib/tree/parsers/vectorParser.d.ts.map +1 -0
- package/lib/tree/parsers/vectorParser.js +13 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAapE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,8BAAsB,qBAAqB;IACzC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAa5D,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IActD;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CACrB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAAY;IAoBxB,MAAM,CAAC,4BAA4B,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAAY;IAqBxB,MAAM,CAAC,UAAU,CACf,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,UAAU,GAAG,UAAU,EAC3B,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,GAAE,MAAY;CAmCzB;AAED,qBAAa,UAAU;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY;IAa1D,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAM9B,QAAQ,IAAI,MAAM,EAAE;IAmCpB,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU;IAyBvC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU;IAQ7B,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAuBnC,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU;IAqBnC,QAAQ,IAAI,UAAU;IAOtB,QAAQ,IAAI,UAAU;IAWtB,cAAc,IAAI,UAAU;IAiB5B,eAAe,CAAC,IAAI,CAAC,EAAE,WAAW;IA+BlC,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAO5B,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM;IAiB7C,YAAY,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU;IAiBxC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW;IAuCzB,KAAK,IAAI,MAAM;IA0Bf,YAAY,IAAI,MAAM;CAGvB"}
|
|
@@ -35,11 +35,11 @@ export class GeometricSequenceConstructor {
|
|
|
35
35
|
switch (type) {
|
|
36
36
|
case NumberType.Decimal:
|
|
37
37
|
reason = coinFlip()
|
|
38
|
-
? randfloat(-0.
|
|
38
|
+
? randfloat(-0.99, 1, 2).toTree()
|
|
39
39
|
: randfloat(1.01, 10, 2).toTree();
|
|
40
40
|
break;
|
|
41
41
|
case NumberType.Integer:
|
|
42
|
-
reason = randint(2, 10
|
|
42
|
+
reason = randint(2, 10).toTree();
|
|
43
43
|
break;
|
|
44
44
|
case NumberType.Rational:
|
|
45
45
|
reason = RationalConstructor.randomIrreductible().toTree();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AlgebraicNode } from "../../tree/nodes/algebraicNode.js";
|
|
2
2
|
import { Integer } from "../numbers/integer/integer.js";
|
|
3
3
|
declare enum SequenceType {
|
|
4
4
|
arithmetic = 0,
|
|
@@ -8,7 +8,7 @@ declare enum SequenceType {
|
|
|
8
8
|
export declare class Sequence {
|
|
9
9
|
type: SequenceType;
|
|
10
10
|
firstRank: Integer;
|
|
11
|
-
firstTerm:
|
|
11
|
+
firstTerm: AlgebraicNode;
|
|
12
12
|
recurrenceFormula?: string;
|
|
13
13
|
explicitFormula?: string;
|
|
14
14
|
recurrenceEvaluator?: (x: number) => number;
|
|
@@ -17,7 +17,7 @@ export declare class Sequence {
|
|
|
17
17
|
recurrenceFormula?: string;
|
|
18
18
|
explicitFormula?: string;
|
|
19
19
|
firstRank: Integer;
|
|
20
|
-
firstTerm:
|
|
20
|
+
firstTerm: AlgebraicNode;
|
|
21
21
|
recurrenceEvaluator: (x: number) => number;
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../../../src/math/sequences/sequence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../../../src/math/sequences/sequence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,aAAK,YAAY;IACf,UAAU,IAAA;IACV,SAAS,IAAA;IACT,KAAK,IAAA;CACN;AAED,qBAAa,QAAQ;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,OAAO,CAAkB;IACpC,SAAS,EAAE,aAAa,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;gBAChC,EACV,IAAI,EACJ,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,SAAS,EACT,mBAAmB,GACpB,EAAE;QACD,IAAI,EAAE,YAAY,CAAC;QACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,EAAE,aAAa,CAAC;QACzB,mBAAmB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;KAC5C;CAQF"}
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,UAAU,YAOtB,CAAC"}
|
package/lib/playground.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EqualNode } from "./tree/nodes/equations/equalNode.js";
|
|
2
|
+
import { parseAlgebraic } from "./tree/parsers/latexParser.js";
|
|
3
3
|
export const playground = () => {
|
|
4
|
-
// const tex = "3\\%";
|
|
5
|
-
// console.log(parseAlgebraic(tex).simplify({}).toTex());
|
|
6
|
-
const x = multiply(3, substract("x", 9));
|
|
7
|
-
// console.log(x.simplify().toTex());
|
|
8
4
|
// console.log(x.equals(x.simplify()));
|
|
5
|
+
const eq = new EqualNode(parseAlgebraic("\\frac{3x+2}{4}"), parseAlgebraic("3x"));
|
|
6
|
+
// console.log(parseAlgebraic("\\left|x^2\\right|").toTex());
|
|
9
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prototypesEnhancement.d.ts","sourceRoot":"","sources":["../src/prototypesEnhancement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"prototypesEnhancement.d.ts","sourceRoot":"","sources":["../src/prototypesEnhancement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAKpE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAIhE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,UAAU,GAAG,YAAY,CAAC;QAC1D,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;IACD,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,WAAW,EAAE,MAAM,MAAM,CAAC;KAC3B;CACF;AAqBD,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algebraicNode.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/algebraicNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,
|
|
1
|
+
{"version":3,"file":"algebraicNode.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/algebraicNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AACF,MAAM,WAAW,aAAc,SAAQ,IAAI;IACzC,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe,KAAK,MAAM,CAAC;IAC5E,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,aAAa,CAAC;IAC7E,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,aAAa,EAAE,CAAC;IAC3D,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,eAAe,KAAK,aAAa,CAAC;IACpD,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,OAAO,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;CACjD;AACD,8BAAsB,cAAc;;IAElC,OAAO,CAAC,MAAM,CAAC,QAAQ;CAGxB;AACD,eAAO,MAAM,eAAe,SAAU,IAAI,KAAG,IAAI,IAAI,aACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complexNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/complex/complexNode.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"complexNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/complex/complexNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI5D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAErE,eAAO,MAAM,aAAa,MAAO,aAAa,KAAG,CAAC,IAAI,WAErD,CAAC;AACF,qBAAa,WAAY,YAAW,aAAa;IAC/C,EAAE,EAAE,aAAa,CAAC;IAClB,EAAE,EAAE,aAAa,CAAC;IAClB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAoB;IAClC,SAAS,EAAE,OAAO,CAAC;gBACP,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAMpE,aAAa;;;;;;;;;IAOb,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa,EAAE;IAkBtD,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAI5C,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAUf,QAAQ;IAGR,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;IAG3C,MAAM,CAAC,IAAI,EAAE,aAAa;IAK1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe;IAG9D,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;CAYzD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AlgebraicNode } from "../algebraicNode.js";
|
|
2
|
-
import {
|
|
1
|
+
import { AlgebraicNode, EvaluateOptions } from "../algebraicNode.js";
|
|
2
|
+
import { NodeIds, NodeOptions, NodeType } from "../node.js";
|
|
3
3
|
import { NodeIdentifiers } from "../nodeConstructor.js";
|
|
4
4
|
export declare const equal: (a: AlgebraicNode | number | string, b: AlgebraicNode | number | string) => EqualNode;
|
|
5
5
|
export type EqualNodeIdentifiers = {
|
|
@@ -11,21 +11,27 @@ export type EqualNodeIdentifiers = {
|
|
|
11
11
|
export declare abstract class EqualNodeConstructor {
|
|
12
12
|
static fromIdentifiers(identifiers: EqualNodeIdentifiers): EqualNode;
|
|
13
13
|
}
|
|
14
|
-
export declare const isEqualNode: (node:
|
|
15
|
-
export declare class EqualNode implements
|
|
16
|
-
leftChild:
|
|
17
|
-
rightChild:
|
|
14
|
+
export declare const isEqualNode: (node: AlgebraicNode) => node is EqualNode;
|
|
15
|
+
export declare class EqualNode implements AlgebraicNode {
|
|
16
|
+
leftChild: AlgebraicNode;
|
|
17
|
+
rightChild: AlgebraicNode;
|
|
18
18
|
opts?: NodeOptions;
|
|
19
19
|
type: NodeType;
|
|
20
|
-
|
|
20
|
+
isNumeric: boolean;
|
|
21
|
+
constructor(leftChild: AlgebraicNode, rightChild: AlgebraicNode, opts?: NodeOptions);
|
|
21
22
|
toIdentifiers(): EqualNodeIdentifiers;
|
|
22
|
-
toEquivalentNodes(opts?: NodeOptions):
|
|
23
|
+
toEquivalentNodes(opts?: NodeOptions): AlgebraicNode[];
|
|
23
24
|
toAllValidTexs(opts?: NodeOptions): string[];
|
|
24
25
|
toMathString(): string;
|
|
25
26
|
toTex(): string;
|
|
26
27
|
simplify(): this;
|
|
27
28
|
shuffle(): EqualNode;
|
|
28
29
|
reverse(): EqualNode;
|
|
30
|
+
isolate(varName: string): EqualNode;
|
|
31
|
+
derivative(varName?: string): AlgebraicNode;
|
|
32
|
+
equals(node: AlgebraicNode): boolean;
|
|
33
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
34
|
+
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): AlgebraicNode;
|
|
29
35
|
}
|
|
30
36
|
export declare const equationResolutionTex: (a: AlgebraicNode, b: AlgebraicNode, c: AlgebraicNode, d: AlgebraicNode) => string | string[];
|
|
31
37
|
//# sourceMappingURL=equalNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equalNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/equalNode.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"equalNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/equalNode.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,eAAe,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAQ/B,eAAO,MAAM,KAAK,MACb,aAAa,GAAG,MAAM,GAAG,MAAM,KAC/B,aAAa,GAAG,MAAM,GAAG,MAAM,cAOnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC;IAClB,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,eAAe,CAAC;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,8BAAsB,oBAAoB;IACxC,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,oBAAoB,GAAG,SAAS;CAOrE;AAED,eAAO,MAAM,WAAW,SAAU,aAAa,KAAG,IAAI,IAAI,SACzB,CAAC;AAElC,qBAAa,SAAU,YAAW,aAAa;IAC7C,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IASpB,aAAa,IAAI,oBAAoB;IAQrC,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAmBpC,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAM5C,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAIf,QAAQ;IAIR,OAAO;IAIP,OAAO;IAIP,OAAO,CAAC,OAAO,EAAE,MAAM;IA8FvB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;IAG3C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM;IAGvE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,aAAa;CAGzE;AAED,eAAO,MAAM,qBAAqB,MAC7B,aAAa,KACb,aAAa,KACb,aAAa,KACb,aAAa,sBA2DjB,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
2
2
|
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
3
|
+
import { isOppositeNode, opposite } from "../functions/oppositeNode.js";
|
|
4
|
+
import { hasVariableNode } from "../hasVariableNode.js";
|
|
3
5
|
import { NodeIds, NodeType } from "../node.js";
|
|
4
|
-
import {
|
|
5
|
-
import { add } from "../operators/addNode.js";
|
|
6
|
-
import { frac } from "../operators/fractionNode.js";
|
|
7
|
-
import { multiply } from "../operators/multiplyNode.js";
|
|
8
|
-
import { substract } from "../operators/substractNode.js";
|
|
6
|
+
import { reifyAlgebraic, } from "../nodeConstructor.js";
|
|
7
|
+
import { add, isAddNode } from "../operators/addNode.js";
|
|
8
|
+
import { frac, isFractionNode } from "../operators/fractionNode.js";
|
|
9
|
+
import { isMultiplyNode, multiply } from "../operators/multiplyNode.js";
|
|
10
|
+
import { isSubstractNode, substract } from "../operators/substractNode.js";
|
|
9
11
|
import { monom } from "../polynomials/monomNode.js";
|
|
12
|
+
import { isVariableNode } from "../variables/variableNode.js";
|
|
10
13
|
export const equal = (a, b) => {
|
|
11
14
|
const nodeA = typeof a === "number" ? a.toTree() : typeof a === "string" ? a.toTree() : a;
|
|
12
15
|
const nodeB = typeof b === "number" ? b.toTree() : typeof b === "string" ? b.toTree() : b;
|
|
@@ -14,7 +17,7 @@ export const equal = (a, b) => {
|
|
|
14
17
|
};
|
|
15
18
|
export class EqualNodeConstructor {
|
|
16
19
|
static fromIdentifiers(identifiers) {
|
|
17
|
-
return new EqualNode(
|
|
20
|
+
return new EqualNode(reifyAlgebraic(identifiers.leftChild), reifyAlgebraic(identifiers.rightChild), identifiers.opts);
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
export const isEqualNode = (node) => node.type === NodeType.equality;
|
|
@@ -23,11 +26,13 @@ export class EqualNode {
|
|
|
23
26
|
rightChild;
|
|
24
27
|
opts;
|
|
25
28
|
type;
|
|
29
|
+
isNumeric;
|
|
26
30
|
constructor(leftChild, rightChild, opts) {
|
|
27
31
|
this.leftChild = leftChild;
|
|
28
32
|
this.rightChild = rightChild;
|
|
29
33
|
this.type = NodeType.equality;
|
|
30
34
|
this.opts = opts;
|
|
35
|
+
this.isNumeric = false;
|
|
31
36
|
}
|
|
32
37
|
toIdentifiers() {
|
|
33
38
|
return {
|
|
@@ -72,6 +77,114 @@ export class EqualNode {
|
|
|
72
77
|
reverse() {
|
|
73
78
|
return new EqualNode(this.rightChild, this.leftChild, this.opts);
|
|
74
79
|
}
|
|
80
|
+
isolate(varName) {
|
|
81
|
+
//! bcp d'erreurs ne sont pas gérées, n'utiliser qu'en contexte sain
|
|
82
|
+
//! ne gère que des équations de premier degré
|
|
83
|
+
//!régler le pb des monomNode : faudrait les virer en fait
|
|
84
|
+
//chercher x et noter le top node de l'arbre et la branche de plus grand niveau opposée à x
|
|
85
|
+
//si le top node est add/sub , sub/add la branche opposé à x
|
|
86
|
+
//puis simplifier et récur
|
|
87
|
+
//si le top node est multiply, diviser la branche opposé à x
|
|
88
|
+
//simp et recur
|
|
89
|
+
//si le top node est frac :
|
|
90
|
+
/// si x est num, multiply par branche opposé
|
|
91
|
+
///simp et recur
|
|
92
|
+
/// si x est dénum, appliquer fct inverse
|
|
93
|
+
///simp et recur
|
|
94
|
+
let right = (0).toTree();
|
|
95
|
+
const simpOpts = {
|
|
96
|
+
towardsDistribute: true,
|
|
97
|
+
forbidFactorize: true,
|
|
98
|
+
};
|
|
99
|
+
let left = substract(this.leftChild, this.rightChild).simplify(simpOpts);
|
|
100
|
+
// let simp = new EqualNode(left, right);
|
|
101
|
+
const recur = () => {
|
|
102
|
+
if (isVariableNode(left) && left.name === varName) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
else if (isAddNode(left)) {
|
|
106
|
+
// const xIsLeft = ??
|
|
107
|
+
// if xIsLeft, right = right-node.right, left = left-node.right
|
|
108
|
+
const xIsLeft = hasVariableNode(left.leftChild);
|
|
109
|
+
if (xIsLeft) {
|
|
110
|
+
right = substract(right, left.rightChild).simplify(simpOpts);
|
|
111
|
+
left = substract(left, left.rightChild).simplify(simpOpts);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
right = substract(right, left.leftChild).simplify(simpOpts);
|
|
115
|
+
left = substract(left, left.leftChild).simplify(simpOpts);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else if (isSubstractNode(left)) {
|
|
119
|
+
const xIsLeft = hasVariableNode(left.leftChild);
|
|
120
|
+
if (xIsLeft) {
|
|
121
|
+
right = add(right, left.rightChild).simplify(simpOpts);
|
|
122
|
+
left = add(left, left.rightChild).simplify(simpOpts);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
right = substract(right, left.leftChild).simplify(simpOpts);
|
|
126
|
+
left = substract(left, left.leftChild).simplify(simpOpts);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else if (isMultiplyNode(left)) {
|
|
130
|
+
const xIsLeft = hasVariableNode(left.leftChild);
|
|
131
|
+
if (xIsLeft) {
|
|
132
|
+
right = frac(right, left.rightChild).simplify(simpOpts);
|
|
133
|
+
left = frac(left, left.rightChild).simplify(simpOpts);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
right = frac(right, left.leftChild).simplify(simpOpts);
|
|
137
|
+
left = frac(left, left.leftChild).simplify(simpOpts);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else if (isFractionNode(left)) {
|
|
141
|
+
console.log(left.leftChild);
|
|
142
|
+
const xIsLeft = hasVariableNode(left.leftChild);
|
|
143
|
+
if (xIsLeft) {
|
|
144
|
+
right = multiply(right, left.rightChild).simplify(simpOpts);
|
|
145
|
+
left = multiply(left, left.rightChild).simplify(simpOpts);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if (right.equals((0).toTree())) {
|
|
149
|
+
//A/f(x) = 0 --> f(x) = 0
|
|
150
|
+
left = left.rightChild.simplify(simpOpts);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
right = frac(1, right).simplify(simpOpts);
|
|
154
|
+
left = frac(1, left).simplify(simpOpts);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else if (isOppositeNode(left)) {
|
|
159
|
+
left = opposite(left).simplify(simpOpts);
|
|
160
|
+
right = opposite(right).simplify(simpOpts);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
throw new Error("Isolation only implemented for basic operations yet");
|
|
164
|
+
}
|
|
165
|
+
recur();
|
|
166
|
+
};
|
|
167
|
+
recur();
|
|
168
|
+
return new EqualNode(left, right);
|
|
169
|
+
//à la fin left = x et right = solution
|
|
170
|
+
}
|
|
171
|
+
// toMathjs() {
|
|
172
|
+
// return equal(this.leftChild.toMathjs(), this.rightChild.toMathjs());
|
|
173
|
+
// }
|
|
174
|
+
// times(x: AlgebraicNode): EqualNode{
|
|
175
|
+
// }
|
|
176
|
+
derivative(varName) {
|
|
177
|
+
throw new Error("unimplemented");
|
|
178
|
+
}
|
|
179
|
+
equals(node) {
|
|
180
|
+
throw new Error("unimplemented");
|
|
181
|
+
}
|
|
182
|
+
evaluate(vars, opts) {
|
|
183
|
+
throw new Error("unimplemented");
|
|
184
|
+
}
|
|
185
|
+
toDetailedEvaluation(vars) {
|
|
186
|
+
throw new Error("unimplemented");
|
|
187
|
+
}
|
|
75
188
|
}
|
|
76
189
|
export const equationResolutionTex = (a, b, c, d) => {
|
|
77
190
|
//(+-a)x(+-b) = (+-c)x(+-d)
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AlgebraicNode, EvaluateOptions } from "../algebraicNode.js";
|
|
2
|
+
import { NodeIds, NodeOptions, NodeType } from "../node.js";
|
|
2
3
|
import { DiscreteSetNode } from "../sets/discreteSetNode.js";
|
|
3
4
|
type EquationSolutionNodeOptions = {
|
|
4
5
|
variable?: string;
|
|
5
6
|
opts?: NodeOptions;
|
|
6
7
|
};
|
|
7
|
-
export declare class EquationSolutionNode implements
|
|
8
|
+
export declare class EquationSolutionNode implements AlgebraicNode {
|
|
8
9
|
type: NodeType;
|
|
9
10
|
variable: string;
|
|
10
11
|
solutionsSet: DiscreteSetNode;
|
|
11
12
|
opts?: NodeOptions;
|
|
13
|
+
isNumeric: boolean;
|
|
12
14
|
constructor(solutionsSet: DiscreteSetNode, params?: EquationSolutionNodeOptions);
|
|
13
15
|
toIdentifiers(): {
|
|
14
16
|
id: NodeIds;
|
|
@@ -25,6 +27,10 @@ export declare class EquationSolutionNode implements Node {
|
|
|
25
27
|
toMathString(): string;
|
|
26
28
|
toTex(): string;
|
|
27
29
|
simplify(): EquationSolutionNode;
|
|
30
|
+
derivative(varName?: string): AlgebraicNode;
|
|
31
|
+
equals(node: AlgebraicNode): boolean;
|
|
32
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
33
|
+
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): AlgebraicNode;
|
|
28
34
|
}
|
|
29
35
|
export {};
|
|
30
36
|
//# sourceMappingURL=equationSolutionNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationSolutionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/equationSolutionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"equationSolutionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/equationSolutionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,KAAK,2BAA2B,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAC7E,qBAAa,oBAAqB,YAAW,aAAa;IACxD,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBAEjB,YAAY,EAAE,eAAe,EAC7B,MAAM,CAAC,EAAE,2BAA2B;IAetC,aAAa;;;;;;;;;IAMb,cAAc;IAId,SAAS;IAkBT,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAQpC,YAAY;IAIZ,KAAK;IAGL,QAAQ;IAGR,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;IAG3C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM;IAGvE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,aAAa;CAGzE"}
|
|
@@ -4,7 +4,9 @@ export class EquationSolutionNode {
|
|
|
4
4
|
variable;
|
|
5
5
|
solutionsSet;
|
|
6
6
|
opts;
|
|
7
|
+
isNumeric;
|
|
7
8
|
constructor(solutionsSet, params) {
|
|
9
|
+
this.isNumeric = false;
|
|
8
10
|
this.type = NodeType.set;
|
|
9
11
|
this.solutionsSet = solutionsSet;
|
|
10
12
|
this.variable = params?.variable ?? "x";
|
|
@@ -56,4 +58,16 @@ export class EquationSolutionNode {
|
|
|
56
58
|
simplify() {
|
|
57
59
|
return new EquationSolutionNode(this.solutionsSet.simplify());
|
|
58
60
|
}
|
|
61
|
+
derivative(varName) {
|
|
62
|
+
throw new Error("unimplemented");
|
|
63
|
+
}
|
|
64
|
+
equals(node) {
|
|
65
|
+
throw new Error("unimplemented");
|
|
66
|
+
}
|
|
67
|
+
evaluate(vars, opts) {
|
|
68
|
+
throw new Error("unimplemented");
|
|
69
|
+
}
|
|
70
|
+
toDetailedEvaluation(vars) {
|
|
71
|
+
throw new Error("unimplemented");
|
|
72
|
+
}
|
|
59
73
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Node, NodeIds, NodeOptions, NodeType } from "../node.js";
|
|
2
|
-
|
|
2
|
+
import { AlgebraicNode, EvaluateOptions } from "../algebraicNode.js";
|
|
3
|
+
export declare class MultiEqualNode implements AlgebraicNode {
|
|
3
4
|
children: Node[];
|
|
4
5
|
opts?: NodeOptions;
|
|
5
6
|
type: NodeType;
|
|
7
|
+
isNumeric: boolean;
|
|
6
8
|
constructor(children: Node[], opts?: NodeOptions);
|
|
7
9
|
toEquivalentNodes(): MultiEqualNode[];
|
|
8
10
|
toIdentifiers(): {
|
|
@@ -17,5 +19,9 @@ export declare class MultiEqualNode implements Node {
|
|
|
17
19
|
toTex(): string;
|
|
18
20
|
toMathjs(): string;
|
|
19
21
|
simplify(): this;
|
|
22
|
+
derivative(varName?: string): AlgebraicNode;
|
|
23
|
+
equals(node: AlgebraicNode): boolean;
|
|
24
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
25
|
+
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): AlgebraicNode;
|
|
20
26
|
}
|
|
21
27
|
//# sourceMappingURL=multiEqualNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiEqualNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/multiEqualNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"multiEqualNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/multiEqualNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAErE,qBAAa,cAAe,YAAW,aAAa;IAClD,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBACP,QAAQ,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,EAAE,WAAW;IAOhD,iBAAiB;IAUjB,aAAa;;;;;;IAMb,SAAS;IAMT,cAAc,IAAI,MAAM,EAAE;IAI1B,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAIf,QAAQ;IAIR,QAAQ;IAIR,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;IAG3C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM;IAGvE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,aAAa;CAGzE"}
|
|
@@ -5,10 +5,12 @@ export class MultiEqualNode {
|
|
|
5
5
|
children;
|
|
6
6
|
opts;
|
|
7
7
|
type;
|
|
8
|
+
isNumeric;
|
|
8
9
|
constructor(children, opts) {
|
|
9
10
|
this.children = children;
|
|
10
11
|
this.type = NodeType.equality;
|
|
11
12
|
this.opts = opts;
|
|
13
|
+
this.isNumeric = false;
|
|
12
14
|
}
|
|
13
15
|
toEquivalentNodes() {
|
|
14
16
|
const res = [];
|
|
@@ -44,4 +46,16 @@ export class MultiEqualNode {
|
|
|
44
46
|
simplify() {
|
|
45
47
|
return this;
|
|
46
48
|
}
|
|
49
|
+
derivative(varName) {
|
|
50
|
+
throw new Error("unimplemented");
|
|
51
|
+
}
|
|
52
|
+
equals(node) {
|
|
53
|
+
throw new Error("unimplemented");
|
|
54
|
+
}
|
|
55
|
+
evaluate(vars, opts) {
|
|
56
|
+
throw new Error("unimplemented");
|
|
57
|
+
}
|
|
58
|
+
toDetailedEvaluation(vars) {
|
|
59
|
+
throw new Error("unimplemented");
|
|
60
|
+
}
|
|
47
61
|
}
|
|
@@ -2,6 +2,7 @@ import { Node, NodeIds, NodeType } from "../node.js";
|
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode.js";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode.js";
|
|
4
4
|
export declare function isArccosNode(a: Node): a is ArccosNode;
|
|
5
|
+
export declare const arccos: (a: AlgebraicNode | number | string) => ArccosNode;
|
|
5
6
|
export declare class ArccosNode implements FunctionNode {
|
|
6
7
|
id: FunctionsIds;
|
|
7
8
|
child: AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arccosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arccosNode.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,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,qBAAa,UAAW,YAAW,YAAY;IAC7C,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,IAAI,aAAa;IAkBzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAItC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAIxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
1
|
+
{"version":3,"file":"arccosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arccosNode.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,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,eAAO,MAAM,MAAM,MAAO,aAAa,GAAG,MAAM,GAAG,MAAM,eAIxD,CAAC;AAEF,qBAAa,UAAW,YAAW,YAAY;IAC7C,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,IAAI,aAAa;IAkBzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAItC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAIxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -5,6 +5,10 @@ import { hasVariableNode } from "../hasVariableNode.js";
|
|
|
5
5
|
export function isArccosNode(a) {
|
|
6
6
|
return isFunctionNode(a) && a.id === FunctionsIds.arccos;
|
|
7
7
|
}
|
|
8
|
+
export const arccos = (a) => {
|
|
9
|
+
const nodeA = typeof a === "number" ? a.toTree() : typeof a === "string" ? a.toTree() : a;
|
|
10
|
+
return new ArccosNode(nodeA);
|
|
11
|
+
};
|
|
8
12
|
export class ArccosNode {
|
|
9
13
|
id;
|
|
10
14
|
child;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { AlgebraicNode } from "../algebraicNode.js";
|
|
2
|
-
import {
|
|
1
|
+
import { AlgebraicNode, EvaluateOptions } from "../algebraicNode.js";
|
|
2
|
+
import { NodeIds, NodeType, ToTexOptions } from "../node.js";
|
|
3
3
|
import { VariableNode } from "../variables/variableNode.js";
|
|
4
|
-
export declare class IntegralNode implements
|
|
4
|
+
export declare class IntegralNode implements AlgebraicNode {
|
|
5
5
|
functionNode: AlgebraicNode;
|
|
6
6
|
lowerBound: AlgebraicNode;
|
|
7
7
|
upperBound: AlgebraicNode;
|
|
8
8
|
variable: VariableNode;
|
|
9
9
|
type: NodeType;
|
|
10
|
+
isNumeric: boolean;
|
|
10
11
|
constructor(functionNode: AlgebraicNode, lowerBound: AlgebraicNode, upperBound: AlgebraicNode, variable: string);
|
|
11
12
|
toIdentifiers(): {
|
|
12
13
|
id: NodeIds;
|
|
@@ -26,5 +27,9 @@ export declare class IntegralNode implements Node {
|
|
|
26
27
|
toEquivalentNodes(): this[];
|
|
27
28
|
toAllValidTexs(): string[];
|
|
28
29
|
simplify(): this;
|
|
30
|
+
derivative(varName?: string): AlgebraicNode;
|
|
31
|
+
equals(node: AlgebraicNode): boolean;
|
|
32
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
33
|
+
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): AlgebraicNode;
|
|
29
34
|
}
|
|
30
35
|
//# sourceMappingURL=integralNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integralNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/integralNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"integralNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/integralNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAe,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,qBAAa,YAAa,YAAW,aAAa;IAChD,YAAY,EAAE,aAAa,CAAC;IAC5B,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC;IAC1B,QAAQ,EAAE,YAAY,CAAC;IACvB,IAAI,WAAqB;IACzB,SAAS,EAAE,OAAO,CAAC;gBAEjB,YAAY,EAAE,aAAa,EAC3B,UAAU,EAAE,aAAa,EACzB,UAAU,EAAE,aAAa,EACzB,QAAQ,EAAE,MAAM;IAQlB,aAAa;;;;;;;;;;;;;IASb,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM;IAGlC,YAAY;IAGZ,iBAAiB;IAGjB,cAAc;IAGd,QAAQ;IAIR,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;IAG3C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM;IAGvE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,aAAa;CAGzE"}
|
|
@@ -6,11 +6,13 @@ export class IntegralNode {
|
|
|
6
6
|
upperBound;
|
|
7
7
|
variable;
|
|
8
8
|
type = NodeType.function;
|
|
9
|
+
isNumeric;
|
|
9
10
|
constructor(functionNode, lowerBound, upperBound, variable) {
|
|
10
11
|
(this.functionNode = functionNode),
|
|
11
12
|
(this.lowerBound = lowerBound),
|
|
12
13
|
(this.upperBound = upperBound),
|
|
13
14
|
(this.variable = new VariableNode(variable));
|
|
15
|
+
this.isNumeric = false;
|
|
14
16
|
}
|
|
15
17
|
toIdentifiers() {
|
|
16
18
|
return {
|
|
@@ -36,4 +38,16 @@ export class IntegralNode {
|
|
|
36
38
|
simplify() {
|
|
37
39
|
return this;
|
|
38
40
|
}
|
|
41
|
+
derivative(varName) {
|
|
42
|
+
throw new Error("unimplemented");
|
|
43
|
+
}
|
|
44
|
+
equals(node) {
|
|
45
|
+
throw new Error("unimplemented");
|
|
46
|
+
}
|
|
47
|
+
evaluate(vars, opts) {
|
|
48
|
+
throw new Error("unimplemented");
|
|
49
|
+
}
|
|
50
|
+
toDetailedEvaluation(vars) {
|
|
51
|
+
throw new Error("unimplemented");
|
|
52
|
+
}
|
|
39
53
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Point } from "../../../math/geometry/point.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { AlgebraicNode, EvaluateOptions } from "../algebraicNode.js";
|
|
3
|
+
import { NodeIds, NodeOptions, NodeType } from "../node.js";
|
|
4
|
+
export declare class PointNode implements AlgebraicNode {
|
|
4
5
|
opts?: NodeOptions | undefined;
|
|
5
6
|
point: Point;
|
|
6
7
|
type: NodeType;
|
|
8
|
+
isNumeric: boolean;
|
|
7
9
|
constructor(point: Point, opts?: NodeOptions);
|
|
8
10
|
toIdentifiers(): {
|
|
9
11
|
id: NodeIds;
|
|
@@ -11,6 +13,10 @@ export declare class PointNode implements Node {
|
|
|
11
13
|
};
|
|
12
14
|
toAllTexs(): string[];
|
|
13
15
|
toAllValidTexs(): string[];
|
|
16
|
+
derivative(varName?: string): AlgebraicNode;
|
|
17
|
+
equals(node: AlgebraicNode): boolean;
|
|
18
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
19
|
+
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): AlgebraicNode;
|
|
14
20
|
toEquivalentNodes(opts?: NodeOptions): PointNode[];
|
|
15
21
|
toMathString(): string;
|
|
16
22
|
toMathjs(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/pointNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pointNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/pointNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE5D,qBAAa,SAAU,YAAW,aAAa;IAC7C,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEP,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW;IAM5C,aAAa;;;;IAMb,SAAS;IAGT,cAAc;IAMd,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;IAG3C,MAAM,CAAC,IAAI,EAAE,aAAa;IAK1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe;IAG9D,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,aAAa;IAIxE,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAepC,YAAY;IAGZ,QAAQ;IAIR,KAAK;IAGL,QAAQ;CAGT"}
|
|
@@ -5,10 +5,12 @@ export class PointNode {
|
|
|
5
5
|
opts;
|
|
6
6
|
point;
|
|
7
7
|
type;
|
|
8
|
+
isNumeric;
|
|
8
9
|
constructor(point, opts) {
|
|
9
10
|
this.type = NodeType.point;
|
|
10
11
|
this.opts = opts;
|
|
11
12
|
this.point = point;
|
|
13
|
+
this.isNumeric = false;
|
|
12
14
|
}
|
|
13
15
|
toIdentifiers() {
|
|
14
16
|
return {
|
|
@@ -22,6 +24,18 @@ export class PointNode {
|
|
|
22
24
|
toAllValidTexs() {
|
|
23
25
|
return this.toEquivalentNodes(this.opts).flatMap((node) => node.toAllTexs());
|
|
24
26
|
}
|
|
27
|
+
derivative(varName) {
|
|
28
|
+
throw new Error("can't derivate point");
|
|
29
|
+
}
|
|
30
|
+
equals(node) {
|
|
31
|
+
return (node.type === this.type && this.point.equals(node.point));
|
|
32
|
+
}
|
|
33
|
+
evaluate(vars, opts) {
|
|
34
|
+
return NaN;
|
|
35
|
+
}
|
|
36
|
+
toDetailedEvaluation(vars) {
|
|
37
|
+
throw new Error("unimplemented");
|
|
38
|
+
}
|
|
25
39
|
toEquivalentNodes(opts) {
|
|
26
40
|
const res = [];
|
|
27
41
|
const equivs = [
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { AlgebraicNode, EvaluateOptions } from "../algebraicNode.js";
|
|
2
|
+
import { NodeIds, NodeOptions, NodeType } from "../node.js";
|
|
3
|
+
export declare class VectorNode implements AlgebraicNode {
|
|
3
4
|
opts?: NodeOptions | undefined;
|
|
4
5
|
name: string;
|
|
5
6
|
type: NodeType;
|
|
7
|
+
isNumeric: boolean;
|
|
6
8
|
constructor(name: string, opts?: NodeOptions);
|
|
7
9
|
toAllValidTexs(): string[];
|
|
8
10
|
toIdentifiers(): {
|
|
@@ -10,6 +12,10 @@ export declare class VectorNode implements Node {
|
|
|
10
12
|
name: string;
|
|
11
13
|
};
|
|
12
14
|
toEquivalentNodes(opts?: NodeOptions): this[];
|
|
15
|
+
derivative(varName?: string): AlgebraicNode;
|
|
16
|
+
equals(node: AlgebraicNode): boolean;
|
|
17
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
18
|
+
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): AlgebraicNode;
|
|
13
19
|
toMathString(): string;
|
|
14
20
|
toMathjs(): string;
|
|
15
21
|
toTex(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/vectorNode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vectorNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/vectorNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE5D,qBAAa,UAAW,YAAW,aAAa;IAC9C,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEP,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW;IAU5C,cAAc;IAGd,aAAa;;;;IAMb,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAIpC,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;IAG3C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM;IAGvE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,aAAa;IAGxE,YAAY;IAGZ,QAAQ;IAIR,KAAK;IAGL,QAAQ;CAGT"}
|