math-exercises 2.2.9 → 2.2.11
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 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +24 -7
- package/lib/exercises/math/calcul/decimals/index.d.ts +3 -0
- package/lib/exercises/math/calcul/decimals/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/index.js +18 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts +8 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +53 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts +9 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +63 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -1
- package/lib/exercises/math/calcul/index.d.ts +2 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +2 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/expressionNature.js +180 -80
- package/lib/exercises/math/calcul/operations/index.d.ts +3 -0
- package/lib/exercises/math/calcul/operations/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/index.js +3 -0
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.js +20 -5
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +111 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +127 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +18 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/decimalOrdering.js +77 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts +10 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/framing.js +143 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +4 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/index.js +19 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts +8 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.js +61 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- 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/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +9 -6
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +15 -4
- package/lib/exercises/math/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +0 -4
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +2 -3
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +17 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfCube.js +7 -1
- package/lib/exercises/math/index.d.ts +0 -1
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +0 -1
- package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
- package/lib/exercises/math/percent/htToTTC.d.ts +8 -0
- package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -0
- package/lib/exercises/math/percent/htToTTC.js +50 -0
- package/lib/exercises/math/percent/index.d.ts +2 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +2 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts +8 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -0
- package/lib/exercises/math/percent/ttcToHT.js +50 -0
- package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersDivision.js +35 -2
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.js +21 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts +7 -0
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/averageList.js +52 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts +7 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.js +49 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +2 -11
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +42 -0
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +7 -2
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +42 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts +10 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +56 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +1 -0
- package/lib/exercises/math/sequences/index.d.ts +2 -0
- package/lib/exercises/math/sequences/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/index.js +2 -0
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts +10 -0
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/sequenceEvaluation.js +143 -0
- package/lib/exercises/math/sequences/sequencePlot.d.ts +9 -0
- package/lib/exercises/math/sequences/sequencePlot.d.ts.map +1 -0
- package/lib/exercises/math/sequences/sequencePlot.js +94 -0
- package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsIntersection.js +19 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +1 -1
- package/lib/exercises/math/trigonometry/arcValue.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/arcValue.js +23 -0
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +1 -1
- package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
- package/lib/index.d.ts +54 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts +11 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +8 -0
- package/lib/math/numbers/decimals/decimal.d.ts +2 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +18 -0
- package/lib/math/numbers/reals/extendedRingElement.d.ts +3 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/sets/intervals/intervals.d.ts +3 -1
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +9 -5
- package/lib/math/sets/mathSet.d.ts +2 -2
- package/lib/math/sets/mathSet.d.ts.map +1 -1
- package/lib/math/sets/mathSetInterface.d.ts +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +13 -2
- package/lib/server.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.js +0 -3
- package/lib/tree/nodes/complex/complexNode.d.ts +10 -1
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.js +7 -0
- package/lib/tree/nodes/equations/equalNode.d.ts +10 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +7 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +10 -1
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +6 -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 +6 -0
- package/lib/tree/nodes/functions/absNode.d.ts +7 -1
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +6 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.js +8 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +8 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.js +8 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +7 -1
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +8 -1
- package/lib/tree/nodes/functions/expNode.d.ts +7 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +6 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +19 -2
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +20 -0
- package/lib/tree/nodes/functions/log10Node.d.ts +7 -1
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +6 -0
- package/lib/tree/nodes/functions/logNode.d.ts +7 -1
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +6 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts +7 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +6 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +7 -1
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +8 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +7 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +6 -0
- package/lib/tree/nodes/functions/tanNode.d.ts +7 -1
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +8 -1
- package/lib/tree/nodes/geometry/degree.d.ts +5 -1
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.js +6 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts +5 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +6 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +14 -1
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +6 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +5 -1
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +6 -0
- package/lib/tree/nodes/hasVariableNode.d.ts +3 -0
- package/lib/tree/nodes/hasVariableNode.d.ts.map +1 -0
- package/lib/tree/nodes/hasVariableNode.js +16 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +8 -1
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +7 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +19 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +7 -1
- package/lib/tree/nodes/node.d.ts +52 -8
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +49 -21
- package/lib/tree/nodes/nodeConstructor.d.ts +7 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -0
- package/lib/tree/nodes/nodeConstructor.js +170 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts +7 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +9 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +5 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +6 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts +5 -1
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +6 -0
- package/lib/tree/nodes/operators/addNode.d.ts +10 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +16 -6
- package/lib/tree/nodes/operators/divideNode.d.ts +11 -1
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +12 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +10 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +7 -0
- package/lib/tree/nodes/operators/limitNode.d.ts +11 -1
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/limitNode.js +8 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +10 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -0
- package/lib/tree/nodes/operators/powerNode.d.ts +10 -1
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +7 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +11 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +12 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts +10 -1
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.js +7 -0
- package/lib/tree/nodes/sets/closure.d.ts +2 -0
- package/lib/tree/nodes/sets/closure.d.ts.map +1 -1
- package/lib/tree/nodes/sets/closure.js +20 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +10 -2
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +13 -3
- package/lib/tree/nodes/sets/intervalNode.d.ts +14 -2
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +22 -1
- package/lib/tree/nodes/sets/setNode.d.ts +1 -0
- package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +7 -1
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +7 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +5 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +6 -0
- package/lib/tree/utilities/operatorComposition.js +4 -2
- package/lib/types/keyProps.d.ts +13 -0
- package/lib/types/keyProps.d.ts.map +1 -0
- package/lib/types/keyProps.js +2 -0
- package/lib/utils/alignTex.js +11 -9
- package/lib/utils/diceFlip.d.ts.map +1 -1
- package/lib/utils/diceFlip.js +2 -6
- package/package.json +1 -1
|
@@ -15,6 +15,12 @@ class AbsNode {
|
|
|
15
15
|
this.type = node_1.NodeType.function;
|
|
16
16
|
this.isNumeric = child.isNumeric;
|
|
17
17
|
}
|
|
18
|
+
toIdentifiers() {
|
|
19
|
+
return {
|
|
20
|
+
id: node_1.NodeIds.abs,
|
|
21
|
+
child: this.child.toIdentifiers(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
18
24
|
toMathString() {
|
|
19
25
|
return `abs(${this.child.toMathString()})`;
|
|
20
26
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode";
|
|
4
4
|
export declare function isArcsinNode(a: Node): a is ArcsinNode;
|
|
@@ -8,6 +8,12 @@ export declare class ArcsinNode implements FunctionNode {
|
|
|
8
8
|
type: NodeType;
|
|
9
9
|
isNumeric: boolean;
|
|
10
10
|
constructor(child: AlgebraicNode);
|
|
11
|
+
toIdentifiers(): {
|
|
12
|
+
id: NodeIds;
|
|
13
|
+
child: {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
};
|
|
11
17
|
toMathString(): string;
|
|
12
18
|
toTex(): string;
|
|
13
19
|
toEquivalentNodes(): AlgebraicNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arcSinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arcSinNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"arcSinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arcSinNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,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;IAiBzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -4,6 +4,7 @@ exports.ArcsinNode = exports.isArcsinNode = void 0;
|
|
|
4
4
|
const node_1 = require("../node");
|
|
5
5
|
const functionNode_1 = require("./functionNode");
|
|
6
6
|
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
7
|
+
const hasVariableNode_1 = require("../hasVariableNode");
|
|
7
8
|
function isArcsinNode(a) {
|
|
8
9
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.arcsin;
|
|
9
10
|
}
|
|
@@ -15,6 +16,12 @@ class ArcsinNode {
|
|
|
15
16
|
this.type = node_1.NodeType.function;
|
|
16
17
|
this.isNumeric = child.isNumeric;
|
|
17
18
|
}
|
|
19
|
+
toIdentifiers() {
|
|
20
|
+
return {
|
|
21
|
+
id: node_1.NodeIds.arcsin,
|
|
22
|
+
child: this.child.toIdentifiers(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
18
25
|
toMathString() {
|
|
19
26
|
return `arcsin(${this.child.toMathString()})`;
|
|
20
27
|
}
|
|
@@ -34,7 +41,7 @@ class ArcsinNode {
|
|
|
34
41
|
}
|
|
35
42
|
simplify() {
|
|
36
43
|
const simplifiedChild = this.child.simplify();
|
|
37
|
-
if (!(0,
|
|
44
|
+
if (!(0, hasVariableNode_1.hasVariableNode)(simplifiedChild)) {
|
|
38
45
|
const value = simplifiedChild.evaluate({});
|
|
39
46
|
const trigoPoint = remarkableValues_1.remarkableTrigoValues.find((remarkableValue) => remarkableValue.sin.evaluate({}) === value);
|
|
40
47
|
if (!trigoPoint)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode";
|
|
4
4
|
export declare function isArccosNode(a: Node): a is ArccosNode;
|
|
@@ -8,6 +8,12 @@ export declare class ArccosNode implements FunctionNode {
|
|
|
8
8
|
type: NodeType;
|
|
9
9
|
isNumeric: boolean;
|
|
10
10
|
constructor(child: AlgebraicNode);
|
|
11
|
+
toIdentifiers(): {
|
|
12
|
+
id: NodeIds;
|
|
13
|
+
child: {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
};
|
|
11
17
|
toMathString(): string;
|
|
12
18
|
toTex(): string;
|
|
13
19
|
toEquivalentNodes(): 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,QAAQ,
|
|
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,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,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,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -4,6 +4,7 @@ exports.ArccosNode = exports.isArccosNode = void 0;
|
|
|
4
4
|
const node_1 = require("../node");
|
|
5
5
|
const functionNode_1 = require("./functionNode");
|
|
6
6
|
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
7
|
+
const hasVariableNode_1 = require("../hasVariableNode");
|
|
7
8
|
function isArccosNode(a) {
|
|
8
9
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.arccos;
|
|
9
10
|
}
|
|
@@ -15,6 +16,12 @@ class ArccosNode {
|
|
|
15
16
|
this.type = node_1.NodeType.function;
|
|
16
17
|
this.isNumeric = child.isNumeric;
|
|
17
18
|
}
|
|
19
|
+
toIdentifiers() {
|
|
20
|
+
return {
|
|
21
|
+
id: node_1.NodeIds.arccos,
|
|
22
|
+
child: this.child.toIdentifiers(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
18
25
|
toMathString() {
|
|
19
26
|
return `arccos(${this.child.toMathString()})`;
|
|
20
27
|
}
|
|
@@ -34,7 +41,7 @@ class ArccosNode {
|
|
|
34
41
|
}
|
|
35
42
|
simplify() {
|
|
36
43
|
const simplifiedChild = this.child.simplify();
|
|
37
|
-
if (!(0,
|
|
44
|
+
if (!(0, hasVariableNode_1.hasVariableNode)(simplifiedChild)) {
|
|
38
45
|
const value = simplifiedChild.evaluate({});
|
|
39
46
|
const trigoPoint = remarkableValues_1.remarkableTrigoValues.find((remarkableValue) => remarkableValue.cos.evaluate({}) === value);
|
|
40
47
|
if (!trigoPoint)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode";
|
|
4
4
|
export declare function isArctanNode(a: Node): a is ArctanNode;
|
|
@@ -8,6 +8,12 @@ export declare class ArctanNode implements FunctionNode {
|
|
|
8
8
|
type: NodeType;
|
|
9
9
|
isNumeric: boolean;
|
|
10
10
|
constructor(child: AlgebraicNode);
|
|
11
|
+
toIdentifiers(): {
|
|
12
|
+
id: NodeIds;
|
|
13
|
+
child: {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
};
|
|
11
17
|
toMathString(): string;
|
|
12
18
|
toTex(): string;
|
|
13
19
|
toEquivalentNodes(): AlgebraicNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arctanNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arctanNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"arctanNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arctanNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,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,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -4,6 +4,7 @@ exports.ArctanNode = exports.isArctanNode = void 0;
|
|
|
4
4
|
const node_1 = require("../node");
|
|
5
5
|
const functionNode_1 = require("./functionNode");
|
|
6
6
|
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
7
|
+
const hasVariableNode_1 = require("../hasVariableNode");
|
|
7
8
|
function isArctanNode(a) {
|
|
8
9
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.arctan;
|
|
9
10
|
}
|
|
@@ -15,6 +16,12 @@ class ArctanNode {
|
|
|
15
16
|
this.type = node_1.NodeType.function;
|
|
16
17
|
this.isNumeric = child.isNumeric;
|
|
17
18
|
}
|
|
19
|
+
toIdentifiers() {
|
|
20
|
+
return {
|
|
21
|
+
id: node_1.NodeIds.arctan,
|
|
22
|
+
child: this.child.toIdentifiers(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
18
25
|
toMathString() {
|
|
19
26
|
return `arctan(${this.child.toMathString()})`;
|
|
20
27
|
}
|
|
@@ -34,7 +41,7 @@ class ArctanNode {
|
|
|
34
41
|
}
|
|
35
42
|
simplify() {
|
|
36
43
|
const simplifiedChild = this.child.simplify();
|
|
37
|
-
if (!(0,
|
|
44
|
+
if (!(0, hasVariableNode_1.hasVariableNode)(simplifiedChild)) {
|
|
38
45
|
const value = simplifiedChild.evaluate({});
|
|
39
46
|
const trigoPoint = remarkableValues_1.remarkableTrigoValues.find((remarkableValue) => remarkableValue.tan?.evaluate({}) === value);
|
|
40
47
|
if (!trigoPoint)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isCosNode(a: Node): a is CosNode;
|
|
@@ -8,6 +8,12 @@ export declare class CosNode implements FunctionNode {
|
|
|
8
8
|
type: NodeType;
|
|
9
9
|
isNumeric: boolean;
|
|
10
10
|
constructor(child: AlgebraicNode);
|
|
11
|
+
toIdentifiers(): {
|
|
12
|
+
id: NodeIds;
|
|
13
|
+
child: {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
};
|
|
11
17
|
toMathString(): string;
|
|
12
18
|
toTex(): string;
|
|
13
19
|
toEquivalentNodes(): AlgebraicNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/cosNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"cosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/cosNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIlE,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,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -4,6 +4,7 @@ exports.CosNode = exports.isCosNode = void 0;
|
|
|
4
4
|
const node_1 = require("../node");
|
|
5
5
|
const functionNode_1 = require("./functionNode");
|
|
6
6
|
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
7
|
+
const hasVariableNode_1 = require("../hasVariableNode");
|
|
7
8
|
function isCosNode(a) {
|
|
8
9
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.cos;
|
|
9
10
|
}
|
|
@@ -15,6 +16,12 @@ class CosNode {
|
|
|
15
16
|
this.type = node_1.NodeType.function;
|
|
16
17
|
this.isNumeric = child.isNumeric;
|
|
17
18
|
}
|
|
19
|
+
toIdentifiers() {
|
|
20
|
+
return {
|
|
21
|
+
id: node_1.NodeIds.cos,
|
|
22
|
+
child: this.child.toIdentifiers(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
18
25
|
toMathString() {
|
|
19
26
|
return `cos(${this.child.toMathString()})`;
|
|
20
27
|
}
|
|
@@ -34,7 +41,7 @@ class CosNode {
|
|
|
34
41
|
}
|
|
35
42
|
simplify(opts = {}) {
|
|
36
43
|
const simplifiedChild = this.child.simplify();
|
|
37
|
-
if (!(0,
|
|
44
|
+
if (!(0, hasVariableNode_1.hasVariableNode)(simplifiedChild)) {
|
|
38
45
|
let value = simplifiedChild.evaluate({});
|
|
39
46
|
if (opts.isDegree) {
|
|
40
47
|
value = (value * Math.PI) / 180;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode";
|
|
4
4
|
export declare function isExpNode(a: Node): a is ExpNode;
|
|
@@ -9,6 +9,12 @@ export declare class ExpNode implements FunctionNode {
|
|
|
9
9
|
type: NodeType;
|
|
10
10
|
isNumeric: boolean;
|
|
11
11
|
constructor(child: AlgebraicNode, opts?: NodeOptions);
|
|
12
|
+
toIdentifiers(): {
|
|
13
|
+
id: NodeIds;
|
|
14
|
+
child: {
|
|
15
|
+
id: NodeIds;
|
|
16
|
+
} & Record<string, any>;
|
|
17
|
+
};
|
|
12
18
|
toMathString(): string;
|
|
13
19
|
toTex(): string;
|
|
14
20
|
toEquivalentNodes(): AlgebraicNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/expNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"expNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/expNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AACD,qBAAa,OAAQ,YAAW,YAAY;IAC1C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAmBf,iBAAiB,IAAI,aAAa,EAAE;IAUpC,cAAc,IAAI,MAAM,EAAE;IAI1B,QAAQ,IAAI,aAAa;IAOzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -18,6 +18,12 @@ class ExpNode {
|
|
|
18
18
|
this.opts = opts;
|
|
19
19
|
this.isNumeric = child.isNumeric;
|
|
20
20
|
}
|
|
21
|
+
toIdentifiers() {
|
|
22
|
+
return {
|
|
23
|
+
id: node_1.NodeIds.exp,
|
|
24
|
+
child: this.child.toIdentifiers(),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
21
27
|
toMathString() {
|
|
22
28
|
return `e^(${this.child.toMathString()})`;
|
|
23
29
|
}
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import { AlgebraicNode } from "../algebraicNode";
|
|
2
|
-
import { ToTexOptions } from "../node";
|
|
2
|
+
import { Node, NodeIds, NodeType, ToTexOptions } from "../node";
|
|
3
3
|
import { VariableNode } from "../variables/variableNode";
|
|
4
|
-
export declare class IntegralNode {
|
|
4
|
+
export declare class IntegralNode implements Node {
|
|
5
5
|
functionNode: AlgebraicNode;
|
|
6
6
|
lowerBound: AlgebraicNode;
|
|
7
7
|
upperBound: AlgebraicNode;
|
|
8
8
|
variable: VariableNode;
|
|
9
|
+
type: NodeType;
|
|
9
10
|
constructor(functionNode: AlgebraicNode, lowerBound: AlgebraicNode, upperBound: AlgebraicNode, variable: string);
|
|
11
|
+
toIdentifiers(): {
|
|
12
|
+
id: NodeIds;
|
|
13
|
+
functionNode: {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
lowerBound: {
|
|
17
|
+
id: NodeIds;
|
|
18
|
+
} & Record<string, any>;
|
|
19
|
+
upperBound: {
|
|
20
|
+
id: NodeIds;
|
|
21
|
+
} & Record<string, any>;
|
|
22
|
+
variable: VariableNode;
|
|
23
|
+
};
|
|
10
24
|
toTex(opts?: ToTexOptions): string;
|
|
25
|
+
toMathString(): string;
|
|
26
|
+
toEquivalentNodes(): this[];
|
|
27
|
+
toAllValidTexs(): string[];
|
|
11
28
|
}
|
|
12
29
|
//# 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,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"integralNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/integralNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAe,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,qBAAa,YAAa,YAAW,IAAI;IACvC,YAAY,EAAE,aAAa,CAAC;IAC5B,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC;IAC1B,QAAQ,EAAE,YAAY,CAAC;IACvB,IAAI,WAAqB;gBAEvB,YAAY,EAAE,aAAa,EAC3B,UAAU,EAAE,aAAa,EACzB,UAAU,EAAE,aAAa,EACzB,QAAQ,EAAE,MAAM;IAOlB,aAAa;;;;;;;;;;;;;IASb,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM;IAGlC,YAAY;IAGZ,iBAAiB;IAGjB,cAAc;CAGf"}
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IntegralNode = void 0;
|
|
4
|
+
const node_1 = require("../node");
|
|
4
5
|
const variableNode_1 = require("../variables/variableNode");
|
|
5
6
|
class IntegralNode {
|
|
6
7
|
constructor(functionNode, lowerBound, upperBound, variable) {
|
|
8
|
+
this.type = node_1.NodeType.function;
|
|
7
9
|
(this.functionNode = functionNode),
|
|
8
10
|
(this.lowerBound = lowerBound),
|
|
9
11
|
(this.upperBound = upperBound),
|
|
10
12
|
(this.variable = new variableNode_1.VariableNode(variable));
|
|
11
13
|
}
|
|
14
|
+
toIdentifiers() {
|
|
15
|
+
return {
|
|
16
|
+
id: node_1.NodeIds.integral,
|
|
17
|
+
functionNode: this.functionNode.toIdentifiers(),
|
|
18
|
+
lowerBound: this.lowerBound.toIdentifiers(),
|
|
19
|
+
upperBound: this.upperBound.toIdentifiers(),
|
|
20
|
+
variable: this.variable,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
12
23
|
toTex(opts) {
|
|
13
24
|
return `\\int_{${this.lowerBound.toTex()}}^{${this.upperBound.toTex()}} ${this.functionNode.toTex()} \\, \\mathrm{d}${this.variable.toTex()}`;
|
|
14
25
|
}
|
|
26
|
+
toMathString() {
|
|
27
|
+
return `intergral(${this.functionNode.toMathString()}, ${this.lowerBound.toMathString()}, ${this.upperBound.toMathString()}, ${this.variable.toMathString()})`;
|
|
28
|
+
}
|
|
29
|
+
toEquivalentNodes() {
|
|
30
|
+
return [this];
|
|
31
|
+
}
|
|
32
|
+
toAllValidTexs() {
|
|
33
|
+
return [this.toTex()];
|
|
34
|
+
}
|
|
15
35
|
}
|
|
16
36
|
exports.IntegralNode = IntegralNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode";
|
|
4
4
|
export declare function isLog10Node(a: Node): a is Log10Node;
|
|
@@ -9,6 +9,12 @@ export declare class Log10Node implements FunctionNode {
|
|
|
9
9
|
opts?: NodeOptions;
|
|
10
10
|
isNumeric: boolean;
|
|
11
11
|
constructor(child: AlgebraicNode, opts?: NodeOptions);
|
|
12
|
+
toIdentifiers(): {
|
|
13
|
+
id: NodeIds;
|
|
14
|
+
child: {
|
|
15
|
+
id: NodeIds;
|
|
16
|
+
} & Record<string, any>;
|
|
17
|
+
};
|
|
12
18
|
toMathString(): string;
|
|
13
19
|
toTex(): string;
|
|
14
20
|
toEquivalentNodes(): AlgebraicNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10Node.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/log10Node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"log10Node.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/log10Node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,SAAS,CAEnD;AACD,qBAAa,SAAU,YAAW,YAAY;IAC5C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAaf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ,IAAI,aAAa;IAgCzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -22,6 +22,12 @@ class Log10Node {
|
|
|
22
22
|
this.opts = opts;
|
|
23
23
|
this.isNumeric = child.isNumeric;
|
|
24
24
|
}
|
|
25
|
+
toIdentifiers() {
|
|
26
|
+
return {
|
|
27
|
+
id: node_1.NodeIds.log10,
|
|
28
|
+
child: this.child.toIdentifiers(),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
25
31
|
toMathString() {
|
|
26
32
|
return `log_{10}(${this.child.toMathString()})`;
|
|
27
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode";
|
|
4
4
|
export declare function isLogNode(a: Node): a is LogNode;
|
|
@@ -9,6 +9,12 @@ export declare class LogNode implements FunctionNode {
|
|
|
9
9
|
opts?: NodeOptions;
|
|
10
10
|
isNumeric: boolean;
|
|
11
11
|
constructor(child: AlgebraicNode, opts?: NodeOptions);
|
|
12
|
+
toIdentifiers(): {
|
|
13
|
+
id: NodeIds;
|
|
14
|
+
child: {
|
|
15
|
+
id: NodeIds;
|
|
16
|
+
} & Record<string, any>;
|
|
17
|
+
};
|
|
12
18
|
toMathString(): string;
|
|
13
19
|
toTex(): string;
|
|
14
20
|
toEquivalentNodes(): AlgebraicNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AACD,qBAAa,OAAQ,YAAW,YAAY;IAC1C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAaf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ,IAAI,aAAa;IAmCzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -23,6 +23,12 @@ class LogNode {
|
|
|
23
23
|
this.opts = opts;
|
|
24
24
|
this.isNumeric = child.isNumeric;
|
|
25
25
|
}
|
|
26
|
+
toIdentifiers() {
|
|
27
|
+
return {
|
|
28
|
+
id: node_1.NodeIds.log,
|
|
29
|
+
child: this.child.toIdentifiers(),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
26
32
|
toMathString() {
|
|
27
33
|
return `log(${this.child.toMathString()})`;
|
|
28
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { NumberNode } from "../numbers/numberNode";
|
|
4
4
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
@@ -10,6 +10,12 @@ export declare class OppositeNode implements FunctionNode {
|
|
|
10
10
|
opts?: NodeOptions;
|
|
11
11
|
isNumeric: boolean;
|
|
12
12
|
constructor(child: AlgebraicNode, opts?: NodeOptions);
|
|
13
|
+
toIdentifiers(): {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
child: {
|
|
16
|
+
id: NodeIds;
|
|
17
|
+
} & Record<string, any>;
|
|
18
|
+
};
|
|
13
19
|
toMathString(): string;
|
|
14
20
|
toTex(): string;
|
|
15
21
|
toEquivalentNodes(opts?: NodeOptions): AlgebraicNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oppositeNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/oppositeNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"oppositeNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/oppositeNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAM/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAgB,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMlE,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;AAGD,qBAAa,YAAa,YAAW,YAAY;IAC/C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAef,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa,EAAE;IAgCtD;;;;OAIG;IACH,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAQ5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAI/B,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -21,6 +21,12 @@ class OppositeNode {
|
|
|
21
21
|
this.opts = opts;
|
|
22
22
|
this.isNumeric = child.isNumeric;
|
|
23
23
|
}
|
|
24
|
+
toIdentifiers() {
|
|
25
|
+
return {
|
|
26
|
+
id: node_1.NodeIds.opposite,
|
|
27
|
+
child: this.child.toIdentifiers(),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
24
30
|
toMathString() {
|
|
25
31
|
return `-(${this.child.toMathString()})`;
|
|
26
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isSinNode(a: Node): a is SinNode;
|
|
@@ -8,6 +8,12 @@ export declare class SinNode implements FunctionNode {
|
|
|
8
8
|
type: NodeType;
|
|
9
9
|
isNumeric: boolean;
|
|
10
10
|
constructor(child: AlgebraicNode);
|
|
11
|
+
toIdentifiers(): {
|
|
12
|
+
id: NodeIds;
|
|
13
|
+
child: {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
};
|
|
11
17
|
toMathString(): string;
|
|
12
18
|
toTex(): string;
|
|
13
19
|
toEquivalentNodes(): 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,QAAQ,
|
|
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,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIlE,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,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -4,6 +4,7 @@ exports.SinNode = exports.isSinNode = void 0;
|
|
|
4
4
|
const node_1 = require("../node");
|
|
5
5
|
const functionNode_1 = require("./functionNode");
|
|
6
6
|
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
7
|
+
const hasVariableNode_1 = require("../hasVariableNode");
|
|
7
8
|
function isSinNode(a) {
|
|
8
9
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.sin;
|
|
9
10
|
}
|
|
@@ -15,6 +16,12 @@ class SinNode {
|
|
|
15
16
|
this.type = node_1.NodeType.function;
|
|
16
17
|
this.isNumeric = child.isNumeric;
|
|
17
18
|
}
|
|
19
|
+
toIdentifiers() {
|
|
20
|
+
return {
|
|
21
|
+
id: node_1.NodeIds.sin,
|
|
22
|
+
child: this.child.toIdentifiers(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
18
25
|
toMathString() {
|
|
19
26
|
return `sin(${this.child.toMathString()})`;
|
|
20
27
|
}
|
|
@@ -34,7 +41,7 @@ class SinNode {
|
|
|
34
41
|
}
|
|
35
42
|
simplify(opts = {}) {
|
|
36
43
|
const simplifiedChild = this.child.simplify();
|
|
37
|
-
if (!(0,
|
|
44
|
+
if (!(0, hasVariableNode_1.hasVariableNode)(simplifiedChild)) {
|
|
38
45
|
let value = simplifiedChild.evaluate({});
|
|
39
46
|
if (opts.isDegree) {
|
|
40
47
|
value = (value * Math.PI) / 180;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isSqrtNode(a: Node): a is SqrtNode;
|
|
@@ -9,6 +9,12 @@ export declare class SqrtNode implements FunctionNode {
|
|
|
9
9
|
opts?: NodeOptions;
|
|
10
10
|
isNumeric: boolean;
|
|
11
11
|
constructor(child: AlgebraicNode, opts?: NodeOptions);
|
|
12
|
+
toIdentifiers(): {
|
|
13
|
+
id: NodeIds;
|
|
14
|
+
child: {
|
|
15
|
+
id: NodeIds;
|
|
16
|
+
} & Record<string, any>;
|
|
17
|
+
};
|
|
12
18
|
toMathString(): string;
|
|
13
19
|
toTex(): string;
|
|
14
20
|
toEquivalentNodes(opts?: NodeOptions): AlgebraicNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqrtNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sqrtNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"sqrtNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sqrtNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAK5E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAElE,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,QAAQ,CAEjD;AACD,qBAAa,QAAS,YAAW,YAAY;IAC3C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAMtB,KAAK,IAAI,MAAM;IAIf,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa,EAAE;IAwBtD,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAG5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAmC/B,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -21,6 +21,12 @@ class SqrtNode {
|
|
|
21
21
|
this.opts = opts;
|
|
22
22
|
this.isNumeric = child.isNumeric;
|
|
23
23
|
}
|
|
24
|
+
toIdentifiers() {
|
|
25
|
+
return {
|
|
26
|
+
id: node_1.NodeIds.sqrt,
|
|
27
|
+
child: this.child.toIdentifiers(),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
24
30
|
toMathString() {
|
|
25
31
|
return `sqr(${this.child.toMathString()})`;
|
|
26
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isTanNode(a: Node): a is TanNode;
|
|
@@ -8,6 +8,12 @@ export declare class TanNode implements FunctionNode {
|
|
|
8
8
|
type: NodeType;
|
|
9
9
|
isNumeric: boolean;
|
|
10
10
|
constructor(child: AlgebraicNode);
|
|
11
|
+
toIdentifiers(): {
|
|
12
|
+
id: NodeIds;
|
|
13
|
+
child: {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
};
|
|
11
17
|
toMathString(): string;
|
|
12
18
|
toTex(): string;
|
|
13
19
|
toEquivalentNodes(): 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,QAAQ,
|
|
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,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIlE,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,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAGrC"}
|
|
@@ -4,6 +4,7 @@ exports.TanNode = exports.isTanNode = void 0;
|
|
|
4
4
|
const node_1 = require("../node");
|
|
5
5
|
const functionNode_1 = require("./functionNode");
|
|
6
6
|
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
7
|
+
const hasVariableNode_1 = require("../hasVariableNode");
|
|
7
8
|
function isTanNode(a) {
|
|
8
9
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.tan;
|
|
9
10
|
}
|
|
@@ -15,6 +16,12 @@ class TanNode {
|
|
|
15
16
|
this.type = node_1.NodeType.function;
|
|
16
17
|
this.isNumeric = child.isNumeric;
|
|
17
18
|
}
|
|
19
|
+
toIdentifiers() {
|
|
20
|
+
return {
|
|
21
|
+
id: node_1.NodeIds.tan,
|
|
22
|
+
child: this.child.toIdentifiers(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
18
25
|
toMathString() {
|
|
19
26
|
return `tan(${this.child.toMathString()})`;
|
|
20
27
|
}
|
|
@@ -34,7 +41,7 @@ class TanNode {
|
|
|
34
41
|
}
|
|
35
42
|
simplify(opts = {}) {
|
|
36
43
|
const simplifiedChild = this.child.simplify();
|
|
37
|
-
if (!(0,
|
|
44
|
+
if (!(0, hasVariableNode_1.hasVariableNode)(simplifiedChild)) {
|
|
38
45
|
let value = simplifiedChild.evaluate({});
|
|
39
46
|
if (opts.isDegree) {
|
|
40
47
|
value = (value * Math.PI) / 180;
|