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.
Files changed (293) hide show
  1. package/lib/exercises/exercise.d.ts +2 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +24 -7
  5. package/lib/exercises/math/calcul/decimals/index.d.ts +3 -0
  6. package/lib/exercises/math/calcul/decimals/index.d.ts.map +1 -0
  7. package/lib/exercises/math/calcul/decimals/index.js +18 -0
  8. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts +8 -0
  9. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -0
  10. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +53 -0
  11. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts +9 -0
  12. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -0
  13. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +63 -0
  14. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
  15. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -1
  16. package/lib/exercises/math/calcul/index.d.ts +2 -0
  17. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  18. package/lib/exercises/math/calcul/index.js +2 -0
  19. package/lib/exercises/math/calcul/operations/expressionNature.d.ts +8 -0
  20. package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/operations/expressionNature.js +180 -80
  22. package/lib/exercises/math/calcul/operations/index.d.ts +3 -0
  23. package/lib/exercises/math/calcul/operations/index.d.ts.map +1 -1
  24. package/lib/exercises/math/calcul/operations/index.js +3 -0
  25. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +1 -1
  26. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
  27. package/lib/exercises/math/calcul/operations/operationsPriorities.js +20 -5
  28. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts +8 -0
  29. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -0
  30. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +111 -0
  31. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts +8 -0
  32. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts.map +1 -0
  33. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +127 -0
  34. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
  35. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +18 -1
  36. package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts +9 -0
  37. package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -0
  38. package/lib/exercises/math/calcul/ordering/decimalOrdering.js +77 -0
  39. package/lib/exercises/math/calcul/ordering/framing.d.ts +10 -0
  40. package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -0
  41. package/lib/exercises/math/calcul/ordering/framing.js +143 -0
  42. package/lib/exercises/math/calcul/ordering/index.d.ts +4 -0
  43. package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -0
  44. package/lib/exercises/math/calcul/ordering/index.js +19 -0
  45. package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts +8 -0
  46. package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -0
  47. package/lib/exercises/math/calcul/ordering/integerOrdering.js +61 -0
  48. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
  49. package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
  50. package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
  51. package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
  52. package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
  53. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
  54. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  55. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  56. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  57. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -1
  58. package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +1 -1
  59. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +1 -1
  60. package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
  61. package/lib/exercises/math/functions/basics/graphicInequation.js +9 -6
  62. package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
  63. package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +15 -4
  64. package/lib/exercises/math/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -1
  65. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
  66. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
  67. package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
  68. package/lib/exercises/math/geometry/cartesian/placeAPoint.js +0 -4
  69. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
  70. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +2 -3
  71. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
  72. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +17 -0
  73. package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
  74. package/lib/exercises/math/geometry/volumes/volumeOfCube.js +7 -1
  75. package/lib/exercises/math/index.d.ts +0 -1
  76. package/lib/exercises/math/index.d.ts.map +1 -1
  77. package/lib/exercises/math/index.js +0 -1
  78. package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
  79. package/lib/exercises/math/percent/htToTTC.d.ts +8 -0
  80. package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -0
  81. package/lib/exercises/math/percent/htToTTC.js +50 -0
  82. package/lib/exercises/math/percent/index.d.ts +2 -0
  83. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  84. package/lib/exercises/math/percent/index.js +2 -0
  85. package/lib/exercises/math/percent/ttcToHT.d.ts +8 -0
  86. package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -0
  87. package/lib/exercises/math/percent/ttcToHT.js +50 -0
  88. package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
  89. package/lib/exercises/math/powers/powersDivision.js +35 -2
  90. package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.d.ts.map +1 -1
  91. package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.js +21 -0
  92. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +1 -1
  93. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts +7 -0
  94. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -0
  95. package/lib/exercises/math/probaStat/stats1var/averageList.js +52 -0
  96. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts +7 -0
  97. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -0
  98. package/lib/exercises/math/probaStat/stats1var/etendueList.js +49 -0
  99. package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
  100. package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
  101. package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
  102. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  103. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +2 -11
  104. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.d.ts.map +1 -1
  105. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +42 -0
  106. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
  107. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +7 -2
  108. package/lib/exercises/math/sequences/geometric/geometricFindTerm.d.ts.map +1 -1
  109. package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +42 -0
  110. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts +10 -0
  111. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -0
  112. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +56 -0
  113. package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
  114. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  115. package/lib/exercises/math/sequences/geometric/index.js +1 -0
  116. package/lib/exercises/math/sequences/index.d.ts +2 -0
  117. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  118. package/lib/exercises/math/sequences/index.js +2 -0
  119. package/lib/exercises/math/sequences/sequenceEvaluation.d.ts +10 -0
  120. package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -0
  121. package/lib/exercises/math/sequences/sequenceEvaluation.js +143 -0
  122. package/lib/exercises/math/sequences/sequencePlot.d.ts +9 -0
  123. package/lib/exercises/math/sequences/sequencePlot.d.ts.map +1 -0
  124. package/lib/exercises/math/sequences/sequencePlot.js +94 -0
  125. package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
  126. package/lib/exercises/math/sets/intervals/intervalsIntersection.js +19 -1
  127. package/lib/exercises/math/sets/intervals/intervalsUnion.js +1 -1
  128. package/lib/exercises/math/trigonometry/arcValue.d.ts.map +1 -1
  129. package/lib/exercises/math/trigonometry/arcValue.js +23 -0
  130. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
  131. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -1
  132. package/lib/exercises/pc/motion/typeOfAcceleration.js +1 -1
  133. package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
  134. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
  135. package/lib/index.d.ts +54 -10
  136. package/lib/index.d.ts.map +1 -1
  137. package/lib/math/geometry/point.d.ts +11 -0
  138. package/lib/math/geometry/point.d.ts.map +1 -1
  139. package/lib/math/geometry/point.js +8 -0
  140. package/lib/math/numbers/decimals/decimal.d.ts +2 -0
  141. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  142. package/lib/math/numbers/decimals/decimal.js +18 -0
  143. package/lib/math/numbers/reals/extendedRingElement.d.ts +3 -1
  144. package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
  145. package/lib/math/numbers/reals/real.d.ts +1 -1
  146. package/lib/math/polynomials/trinom.d.ts +1 -1
  147. package/lib/math/sets/intervals/intervals.d.ts +3 -1
  148. package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
  149. package/lib/math/sets/intervals/intervals.js +9 -5
  150. package/lib/math/sets/mathSet.d.ts +2 -2
  151. package/lib/math/sets/mathSet.d.ts.map +1 -1
  152. package/lib/math/sets/mathSetInterface.d.ts +1 -1
  153. package/lib/playground.d.ts.map +1 -1
  154. package/lib/playground.js +13 -2
  155. package/lib/server.d.ts.map +1 -1
  156. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  157. package/lib/tree/nodes/algebraicNode.js +0 -3
  158. package/lib/tree/nodes/complex/complexNode.d.ts +10 -1
  159. package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
  160. package/lib/tree/nodes/complex/complexNode.js +7 -0
  161. package/lib/tree/nodes/equations/equalNode.d.ts +10 -1
  162. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  163. package/lib/tree/nodes/equations/equalNode.js +7 -0
  164. package/lib/tree/nodes/equations/equationSolutionNode.d.ts +10 -1
  165. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  166. package/lib/tree/nodes/equations/equationSolutionNode.js +6 -0
  167. package/lib/tree/nodes/equations/multiEqualNode.d.ts +7 -1
  168. package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
  169. package/lib/tree/nodes/equations/multiEqualNode.js +6 -0
  170. package/lib/tree/nodes/functions/absNode.d.ts +7 -1
  171. package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
  172. package/lib/tree/nodes/functions/absNode.js +6 -0
  173. package/lib/tree/nodes/functions/arcSinNode.d.ts +7 -1
  174. package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
  175. package/lib/tree/nodes/functions/arcSinNode.js +8 -1
  176. package/lib/tree/nodes/functions/arccosNode.d.ts +7 -1
  177. package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
  178. package/lib/tree/nodes/functions/arccosNode.js +8 -1
  179. package/lib/tree/nodes/functions/arctanNode.d.ts +7 -1
  180. package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
  181. package/lib/tree/nodes/functions/arctanNode.js +8 -1
  182. package/lib/tree/nodes/functions/cosNode.d.ts +7 -1
  183. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  184. package/lib/tree/nodes/functions/cosNode.js +8 -1
  185. package/lib/tree/nodes/functions/expNode.d.ts +7 -1
  186. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  187. package/lib/tree/nodes/functions/expNode.js +6 -0
  188. package/lib/tree/nodes/functions/integralNode.d.ts +19 -2
  189. package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
  190. package/lib/tree/nodes/functions/integralNode.js +20 -0
  191. package/lib/tree/nodes/functions/log10Node.d.ts +7 -1
  192. package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
  193. package/lib/tree/nodes/functions/log10Node.js +6 -0
  194. package/lib/tree/nodes/functions/logNode.d.ts +7 -1
  195. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
  196. package/lib/tree/nodes/functions/logNode.js +6 -0
  197. package/lib/tree/nodes/functions/oppositeNode.d.ts +7 -1
  198. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  199. package/lib/tree/nodes/functions/oppositeNode.js +6 -0
  200. package/lib/tree/nodes/functions/sinNode.d.ts +7 -1
  201. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  202. package/lib/tree/nodes/functions/sinNode.js +8 -1
  203. package/lib/tree/nodes/functions/sqrtNode.d.ts +7 -1
  204. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  205. package/lib/tree/nodes/functions/sqrtNode.js +6 -0
  206. package/lib/tree/nodes/functions/tanNode.d.ts +7 -1
  207. package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
  208. package/lib/tree/nodes/functions/tanNode.js +8 -1
  209. package/lib/tree/nodes/geometry/degree.d.ts +5 -1
  210. package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
  211. package/lib/tree/nodes/geometry/degree.js +6 -0
  212. package/lib/tree/nodes/geometry/lengthNode.d.ts +5 -1
  213. package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
  214. package/lib/tree/nodes/geometry/lengthNode.js +6 -0
  215. package/lib/tree/nodes/geometry/pointNode.d.ts +14 -1
  216. package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
  217. package/lib/tree/nodes/geometry/pointNode.js +6 -0
  218. package/lib/tree/nodes/geometry/vectorNode.d.ts +5 -1
  219. package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
  220. package/lib/tree/nodes/geometry/vectorNode.js +6 -0
  221. package/lib/tree/nodes/hasVariableNode.d.ts +3 -0
  222. package/lib/tree/nodes/hasVariableNode.d.ts.map +1 -0
  223. package/lib/tree/nodes/hasVariableNode.js +16 -0
  224. package/lib/tree/nodes/inequations/inequationNode.d.ts +8 -1
  225. package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
  226. package/lib/tree/nodes/inequations/inequationNode.js +7 -0
  227. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +19 -1
  228. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  229. package/lib/tree/nodes/inequations/inequationSolutionNode.js +7 -1
  230. package/lib/tree/nodes/node.d.ts +52 -8
  231. package/lib/tree/nodes/node.d.ts.map +1 -1
  232. package/lib/tree/nodes/node.js +49 -21
  233. package/lib/tree/nodes/nodeConstructor.d.ts +7 -0
  234. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -0
  235. package/lib/tree/nodes/nodeConstructor.js +170 -0
  236. package/lib/tree/nodes/numbers/constantNode.d.ts +7 -1
  237. package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
  238. package/lib/tree/nodes/numbers/constantNode.js +9 -1
  239. package/lib/tree/nodes/numbers/numberNode.d.ts +5 -1
  240. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  241. package/lib/tree/nodes/numbers/numberNode.js +6 -0
  242. package/lib/tree/nodes/numbers/percentNode.d.ts +5 -1
  243. package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
  244. package/lib/tree/nodes/numbers/percentNode.js +6 -0
  245. package/lib/tree/nodes/operators/addNode.d.ts +10 -1
  246. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  247. package/lib/tree/nodes/operators/addNode.js +16 -6
  248. package/lib/tree/nodes/operators/divideNode.d.ts +11 -1
  249. package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
  250. package/lib/tree/nodes/operators/divideNode.js +12 -0
  251. package/lib/tree/nodes/operators/fractionNode.d.ts +10 -1
  252. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  253. package/lib/tree/nodes/operators/fractionNode.js +7 -0
  254. package/lib/tree/nodes/operators/limitNode.d.ts +11 -1
  255. package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
  256. package/lib/tree/nodes/operators/limitNode.js +8 -0
  257. package/lib/tree/nodes/operators/multiplyNode.d.ts +10 -1
  258. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  259. package/lib/tree/nodes/operators/multiplyNode.js +7 -0
  260. package/lib/tree/nodes/operators/powerNode.d.ts +10 -1
  261. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  262. package/lib/tree/nodes/operators/powerNode.js +7 -0
  263. package/lib/tree/nodes/operators/substractNode.d.ts +11 -1
  264. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  265. package/lib/tree/nodes/operators/substractNode.js +12 -0
  266. package/lib/tree/nodes/sets/belongsNode.d.ts +10 -1
  267. package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
  268. package/lib/tree/nodes/sets/belongsNode.js +7 -0
  269. package/lib/tree/nodes/sets/closure.d.ts +2 -0
  270. package/lib/tree/nodes/sets/closure.d.ts.map +1 -1
  271. package/lib/tree/nodes/sets/closure.js +20 -0
  272. package/lib/tree/nodes/sets/discreteSetNode.d.ts +10 -2
  273. package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
  274. package/lib/tree/nodes/sets/discreteSetNode.js +13 -3
  275. package/lib/tree/nodes/sets/intervalNode.d.ts +14 -2
  276. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  277. package/lib/tree/nodes/sets/intervalNode.js +22 -1
  278. package/lib/tree/nodes/sets/setNode.d.ts +1 -0
  279. package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
  280. package/lib/tree/nodes/sets/unionIntervalNode.d.ts +7 -1
  281. package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
  282. package/lib/tree/nodes/sets/unionIntervalNode.js +7 -1
  283. package/lib/tree/nodes/variables/variableNode.d.ts +5 -1
  284. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  285. package/lib/tree/nodes/variables/variableNode.js +6 -0
  286. package/lib/tree/utilities/operatorComposition.js +4 -2
  287. package/lib/types/keyProps.d.ts +13 -0
  288. package/lib/types/keyProps.d.ts.map +1 -0
  289. package/lib/types/keyProps.js +2 -0
  290. package/lib/utils/alignTex.js +11 -9
  291. package/lib/utils/diceFlip.d.ts.map +1 -1
  292. package/lib/utils/diceFlip.js +2 -6
  293. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Node, NodeType } from "../node";
1
+ import { Node, NodeIds, NodeType } from "../node";
2
2
  import { AlgebraicNode } from "../algebraicNode";
3
3
  export declare function isDegreeNode(a: Node): a is DegreeNode;
4
4
  export declare class DegreeNode implements AlgebraicNode {
@@ -8,6 +8,10 @@ export declare class DegreeNode implements AlgebraicNode {
8
8
  type: NodeType;
9
9
  isNumeric: boolean;
10
10
  constructor(value: number, tex?: string, mathString?: string);
11
+ toIdentifiers(): {
12
+ id: NodeIds;
13
+ value: number;
14
+ };
11
15
  toMathString(): string;
12
16
  toTex(): string;
13
17
  toMathjs(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"degree.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/degree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,qBAAa,UAAW,YAAW,aAAa;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAmB;IACjC,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAQ5D,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAGf,QAAQ;IAGR,cAAc;IAOd,iBAAiB;IAGjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;CAG3B"}
1
+ {"version":3,"file":"degree.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/degree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,qBAAa,UAAW,YAAW,aAAa;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAmB;IACjC,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAO5D,aAAa;;;;IAMb,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAGf,QAAQ;IAGR,cAAc;IAOd,iBAAiB;IAGjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;CAG3B"}
@@ -15,6 +15,12 @@ class DegreeNode {
15
15
  this.mathString = mathString || this.value + "^\\circ";
16
16
  this.isNumeric = true;
17
17
  }
18
+ toIdentifiers() {
19
+ return {
20
+ id: node_1.NodeIds.degree,
21
+ value: this.value,
22
+ };
23
+ }
18
24
  toMathString() {
19
25
  return `${this.mathString}`;
20
26
  }
@@ -1,5 +1,5 @@
1
1
  import { AlgebraicNode } from "../algebraicNode";
2
- import { Node, NodeOptions, NodeType } from "../node";
2
+ import { Node, NodeIds, NodeOptions, NodeType } from "../node";
3
3
  export declare function isLengthNode(a: Node): a is LengthNode;
4
4
  export declare class LengthNode implements AlgebraicNode {
5
5
  opts?: NodeOptions | undefined;
@@ -8,6 +8,10 @@ export declare class LengthNode implements AlgebraicNode {
8
8
  isNumeric: boolean;
9
9
  constructor(segmentName: string, opts?: NodeOptions);
10
10
  toAllValidTexs(): string[];
11
+ toIdentifiers(): {
12
+ id: NodeIds;
13
+ name: string;
14
+ };
11
15
  toEquivalentNodes(opts?: NodeOptions): LengthNode[];
12
16
  toMathString(): string;
13
17
  toMathjs(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"lengthNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/lengthNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AACD,qBAAa,UAAW,YAAW,aAAa;IAC9C,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBACP,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW;IAUnD,cAAc;IAId,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAOpC,YAAY;IAGZ,QAAQ;IAIR,KAAK;IAIL,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQrC,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;CAG3B"}
1
+ {"version":3,"file":"lengthNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/lengthNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AACD,qBAAa,UAAW,YAAW,aAAa;IAC9C,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBACP,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW;IAUnD,cAAc;IAGd,aAAa;;;;IAMb,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAOpC,YAAY;IAGZ,QAAQ;IAIR,KAAK;IAIL,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQrC,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;CAG3B"}
@@ -19,6 +19,12 @@ class LengthNode {
19
19
  toAllValidTexs() {
20
20
  return this.toEquivalentNodes(this.opts).flatMap((node) => node.toTex());
21
21
  }
22
+ toIdentifiers() {
23
+ return {
24
+ id: node_1.NodeIds.length,
25
+ name: this.segmentName,
26
+ };
27
+ }
22
28
  toEquivalentNodes(opts) {
23
29
  return [
24
30
  this,
@@ -1,10 +1,23 @@
1
1
  import { Point } from "../../../math/geometry/point";
2
- import { Node, NodeOptions, NodeType } from "../node";
2
+ import { Node, NodeIds, NodeOptions, NodeType } from "../node";
3
3
  export declare class PointNode implements Node {
4
4
  opts?: NodeOptions | undefined;
5
5
  point: Point;
6
6
  type: NodeType;
7
7
  constructor(point: Point, opts?: NodeOptions);
8
+ toIdentifiers(): {
9
+ id: NodeIds;
10
+ point: {
11
+ id: string;
12
+ name: string;
13
+ x: {
14
+ id: NodeIds;
15
+ } & Record<string, any>;
16
+ y: {
17
+ id: NodeIds;
18
+ } & Record<string, any>;
19
+ };
20
+ };
8
21
  toAllTexs(): string[];
9
22
  toAllValidTexs(): string[];
10
23
  toEquivalentNodes(opts?: NodeOptions): PointNode[];
@@ -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,2BAA2B,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEtD,qBAAa,SAAU,YAAW,IAAI;IACpC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;gBAEH,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW;IAM5C,SAAS;IAGT,cAAc;IAMd,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAepC,YAAY;IAGZ,QAAQ;IAIR,KAAK;CAGN"}
1
+ {"version":3,"file":"pointNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/pointNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,qBAAa,SAAU,YAAW,IAAI;IACpC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;gBAEH,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW;IAK5C,aAAa;;;;;;;;;;;;;IAMb,SAAS;IAGT,cAAc;IAMd,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAepC,YAAY;IAGZ,QAAQ;IAIR,KAAK;CAGN"}
@@ -10,6 +10,12 @@ class PointNode {
10
10
  this.opts = opts;
11
11
  this.point = point;
12
12
  }
13
+ toIdentifiers() {
14
+ return {
15
+ id: node_1.NodeIds.point,
16
+ point: this.point.toIdentifiers(),
17
+ };
18
+ }
13
19
  toAllTexs() {
14
20
  return [this.point.toTexWithCoords(), this.point.toCoords()];
15
21
  }
@@ -1,10 +1,14 @@
1
- import { Node, NodeOptions, NodeType } from "../node";
1
+ import { Node, NodeIds, NodeOptions, NodeType } from "../node";
2
2
  export declare class VectorNode implements Node {
3
3
  opts?: NodeOptions | undefined;
4
4
  name: string;
5
5
  type: NodeType;
6
6
  constructor(name: string, opts?: NodeOptions);
7
7
  toAllValidTexs(): string[];
8
+ toIdentifiers(): {
9
+ id: NodeIds;
10
+ name: string;
11
+ };
8
12
  toEquivalentNodes(opts?: NodeOptions): this[];
9
13
  toMathString(): string;
10
14
  toMathjs(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"vectorNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/vectorNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEtD,qBAAa,UAAW,YAAW,IAAI;IACrC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;gBAEH,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW;IAS5C,cAAc;IAId,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAIpC,YAAY;IAGZ,QAAQ;IAIR,KAAK;CAGN"}
1
+ {"version":3,"file":"vectorNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/geometry/vectorNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,qBAAa,UAAW,YAAW,IAAI;IACrC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;gBAEH,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW;IAS5C,cAAc;IAGd,aAAa;;;;IAMb,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAIpC,YAAY;IAGZ,QAAQ;IAIR,KAAK;CAGN"}
@@ -14,6 +14,12 @@ class VectorNode {
14
14
  toAllValidTexs() {
15
15
  return this.toEquivalentNodes(this.opts).flatMap((node) => node.toTex());
16
16
  }
17
+ toIdentifiers() {
18
+ return {
19
+ id: node_1.NodeIds.vector,
20
+ name: this.name,
21
+ };
22
+ }
17
23
  toEquivalentNodes(opts) {
18
24
  return [this];
19
25
  }
@@ -0,0 +1,3 @@
1
+ import { Node } from "./node";
2
+ export declare const hasVariableNode: (n: Node) => boolean;
3
+ //# sourceMappingURL=hasVariableNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasVariableNode.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/hasVariableNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B,eAAO,MAAM,eAAe,MAAO,IAAI,KAAG,OAMzC,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasVariableNode = void 0;
4
+ const functionNode_1 = require("./functions/functionNode");
5
+ const operatorNode_1 = require("./operators/operatorNode");
6
+ const variableNode_1 = require("./variables/variableNode");
7
+ const hasVariableNode = (n) => {
8
+ if ((0, variableNode_1.isVariableNode)(n))
9
+ return true;
10
+ if ((0, operatorNode_1.isOperatorNode)(n))
11
+ return (0, exports.hasVariableNode)(n.leftChild) || (0, exports.hasVariableNode)(n.rightChild);
12
+ if ((0, functionNode_1.isFunctionNode)(n))
13
+ return (0, exports.hasVariableNode)(n.child);
14
+ return false;
15
+ };
16
+ exports.hasVariableNode = hasVariableNode;
@@ -1,5 +1,5 @@
1
1
  import { InegalitySymbols } from "../../../math/inequations/inequation";
2
- import { Node, NodeOptions, NodeType } from "../node";
2
+ import { Node, NodeIds, NodeOptions, NodeType } from "../node";
3
3
  import { IntervalNode } from "../sets/intervalNode";
4
4
  export declare class InequationNode implements Node {
5
5
  opts?: NodeOptions | undefined;
@@ -8,6 +8,13 @@ export declare class InequationNode implements Node {
8
8
  children: Node[];
9
9
  symbols: InegalitySymbols[];
10
10
  constructor(children: Node[], symbols: InegalitySymbols[] | InegalitySymbols);
11
+ toIdentifiers(): {
12
+ id: NodeIds;
13
+ children: ({
14
+ id: NodeIds;
15
+ } & Record<string, any>)[];
16
+ symbols: InegalitySymbols[];
17
+ };
11
18
  toInterval(): IntervalNode;
12
19
  toReversed(): InequationNode;
13
20
  toAllValidTexs(): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"inequationNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/inequations/inequationNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEjB,MAAM,mCAAmC,CAAC;AAI3C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qBAAa,cAAe,YAAW,IAAI;IACzC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB,OAAO,EAAE,gBAAgB,EAAE,CAAC;gBAE1B,QAAQ,EAAE,IAAI,EAAE,EAChB,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB;IAwBhD,UAAU;IA6CV,UAAU;IAQV,cAAc;IAGd,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS;IAYhD,YAAY;IAGZ,QAAQ;IAGR,SAAS;IAGT,KAAK;CAGN"}
1
+ {"version":3,"file":"inequationNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/inequations/inequationNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEjB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qBAAa,cAAe,YAAW,IAAI;IACzC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB,OAAO,EAAE,gBAAgB,EAAE,CAAC;gBAE1B,QAAQ,EAAE,IAAI,EAAE,EAChB,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB;IAuBhD,aAAa;;;;;;;IAOb,UAAU;IA6CV,UAAU;IAQV,cAAc;IAGd,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS;IAYhD,YAAY;IAGZ,QAAQ;IAGR,SAAS;IAGT,KAAK;CAGN"}
@@ -29,6 +29,13 @@ class InequationNode {
29
29
  }
30
30
  this.type = node_1.NodeType.inequation;
31
31
  }
32
+ toIdentifiers() {
33
+ return {
34
+ id: node_1.NodeIds.inequation,
35
+ children: this.children.map((e) => e.toIdentifiers()),
36
+ symbols: this.symbols,
37
+ };
38
+ }
32
39
  toInterval() {
33
40
  if (this.children.length > 3)
34
41
  throw Error("can't build interval with this inequality");
@@ -1,4 +1,4 @@
1
- import { Node, NodeOptions, NodeType } from "../node";
1
+ import { Node, NodeIds, NodeOptions, NodeType } from "../node";
2
2
  import { IntervalNode } from "../sets/intervalNode";
3
3
  import { UnionIntervalNode } from "../sets/unionIntervalNode";
4
4
  type InequationSolutionNodeOptions = {
@@ -11,6 +11,24 @@ export declare class InequationSolutionNode implements Node {
11
11
  intervalSolution: IntervalNode | UnionIntervalNode;
12
12
  opts?: NodeOptions;
13
13
  constructor(intervalSolution: IntervalNode | UnionIntervalNode, params?: InequationSolutionNodeOptions);
14
+ toIdentifiers(): {
15
+ id: NodeIds;
16
+ intervalSolution: {
17
+ id: NodeIds;
18
+ children: ({
19
+ id: NodeIds;
20
+ } & Record<string, any>)[];
21
+ } | {
22
+ id: NodeIds;
23
+ leftChild: {
24
+ id: NodeIds;
25
+ } & Record<string, any>;
26
+ rightChild: {
27
+ id: NodeIds;
28
+ } & Record<string, any>;
29
+ closure: import("../sets/closure").ClosureType;
30
+ };
31
+ };
14
32
  toAllTexs(): string[];
15
33
  toAllValidTexs(): string[];
16
34
  toEquivalentNodes(opts?: NodeOptions): (import("./inequationNode").InequationNode | InequationSolutionNode)[];
@@ -1 +1 @@
1
- {"version":3,"file":"inequationSolutionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/inequations/inequationSolutionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,YAAY,EAAkB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,KAAK,6BAA6B,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAC/E,qBAAa,sBAAuB,YAAW,IAAI;IACjD,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACnD,IAAI,CAAC,EAAE,WAAW,CAAC;gBAEjB,gBAAgB,EAAE,YAAY,GAAG,iBAAiB,EAClD,MAAM,CAAC,EAAE,6BAA6B;IAcxC,SAAS;IAUT,cAAc;IAId,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAepC,YAAY;IAGZ,QAAQ;IAGR,KAAK;CAGN"}
1
+ {"version":3,"file":"inequationSolutionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/inequations/inequationSolutionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAkB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,KAAK,6BAA6B,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAC/E,qBAAa,sBAAuB,YAAW,IAAI;IACjD,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACnD,IAAI,CAAC,EAAE,WAAW,CAAC;gBAEjB,gBAAgB,EAAE,YAAY,GAAG,iBAAiB,EAClD,MAAM,CAAC,EAAE,6BAA6B;IAaxC,aAAa;;;;;;;;;;;;;;;;;;IAMb,SAAS;IAUT,cAAc;IAId,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAepC,YAAY;IAGZ,QAAQ;IAGR,KAAK;CAGN"}
@@ -15,6 +15,12 @@ class InequationSolutionNode {
15
15
  }
16
16
  : { allowRawRightChildAsSolution: true };
17
17
  }
18
+ toIdentifiers() {
19
+ return {
20
+ id: node_1.NodeIds.inequationSolution,
21
+ intervalSolution: this.intervalSolution.toIdentifiers(),
22
+ };
23
+ }
18
24
  toAllTexs() {
19
25
  const intervalTex = this.intervalSolution.toTex();
20
26
  const res = [
@@ -49,7 +55,7 @@ class InequationSolutionNode {
49
55
  return `S={${this.intervalSolution.toMathjs()}}`;
50
56
  }
51
57
  toTex() {
52
- return `S=\\ ${this.intervalSolution.toTex()}`;
58
+ return `S=${this.intervalSolution.toTex()}`;
53
59
  }
54
60
  }
55
61
  exports.InequationSolutionNode = InequationSolutionNode;
@@ -4,13 +4,13 @@ export declare enum NodeType {
4
4
  variable = 2,
5
5
  operator = 3,
6
6
  function = 4,
7
- set = 5,
8
- inequation = 6,
9
- point = 7,
10
- mesure = 8,
11
- equality = 9,
12
- belongs = 10,
13
- vector = 11
7
+ inequation = 5,
8
+ point = 6,
9
+ mesure = 7,
10
+ equality = 8,
11
+ belongs = 9,
12
+ vector = 10,
13
+ set = 11
14
14
  }
15
15
  export type NodeOptions = {
16
16
  forceTimesSign?: boolean;
@@ -22,6 +22,7 @@ export type NodeOptions = {
22
22
  allowLnOfOne?: boolean;
23
23
  allowPowerOne?: boolean;
24
24
  allowSimplifySqrt?: boolean;
25
+ forceParenthesis?: boolean;
25
26
  };
26
27
  export type ToTexOptions = {
27
28
  displayStyle?: boolean;
@@ -30,7 +31,48 @@ export type ToTexOptions = {
30
31
  hideUnit?: boolean;
31
32
  notScientific?: boolean;
32
33
  forceNoSimplification?: boolean;
34
+ forceParenthesis?: boolean;
33
35
  };
36
+ export declare enum NodeIds {
37
+ add = 0,
38
+ substract = 1,
39
+ multiply = 2,
40
+ fraction = 3,
41
+ divide = 4,
42
+ power = 5,
43
+ limit = 6,
44
+ number = 7,
45
+ percent = 8,
46
+ constant = 9,
47
+ variable = 10,
48
+ belongs = 11,
49
+ discreteSet = 12,
50
+ interval = 13,
51
+ union = 14,
52
+ complex = 15,
53
+ equal = 16,
54
+ multiEqual = 17,
55
+ equationSolution = 18,
56
+ abs = 19,
57
+ arccos = 20,
58
+ arcsin = 21,
59
+ arctan = 22,
60
+ cos = 23,
61
+ sin = 24,
62
+ tan = 25,
63
+ log = 26,
64
+ log10 = 27,
65
+ exp = 28,
66
+ sqrt = 29,
67
+ integral = 30,
68
+ opposite = 31,
69
+ degree = 32,
70
+ length = 33,
71
+ point = 34,
72
+ vector = 35,
73
+ inequation = 36,
74
+ inequationSolution = 37
75
+ }
34
76
  export interface Node {
35
77
  type: NodeType;
36
78
  opts?: NodeOptions;
@@ -38,6 +80,8 @@ export interface Node {
38
80
  toEquivalentNodes: (opts?: NodeOptions) => Node[];
39
81
  toAllValidTexs: (opts?: NodeOptions) => string[];
40
82
  toTex: (opts?: ToTexOptions) => string;
83
+ toIdentifiers: () => {
84
+ id: NodeIds;
85
+ } & Record<string, any>;
41
86
  }
42
- export declare const hasVariableNode: (n: Node) => boolean;
43
87
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/node.ts"],"names":[],"mappings":"AAIA,oBAAY,QAAQ;IAClB,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,GAAG,IAAA;IACH,UAAU,IAAA;IACV,KAAK,IAAA;IACL,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,OAAO,KAAA;IACP,MAAM,KAAA;CACP;AACD,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AACF,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,EAAE,CAAC;IAClD,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,MAAM,EAAE,CAAC;IACjD,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;CAGxC;AAED,eAAO,MAAM,eAAe,MAAO,IAAI,KAAG,OAMzC,CAAC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/node.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,UAAU,IAAA;IACV,KAAK,IAAA;IACL,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,OAAO,IAAA;IACP,MAAM,KAAA;IACN,GAAG,KAAA;CACJ;AACD,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,oBAAY,OAAO;IACjB,GAAG,IAAA;IACH,SAAS,IAAA;IACT,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,MAAM,IAAA;IACN,KAAK,IAAA;IACL,KAAK,IAAA;IACL,MAAM,IAAA;IACN,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,QAAQ,KAAA;IACR,OAAO,KAAA;IACP,WAAW,KAAA;IACX,QAAQ,KAAA;IACR,KAAK,KAAA;IACL,OAAO,KAAA;IACP,KAAK,KAAA;IACL,UAAU,KAAA;IACV,gBAAgB,KAAA;IAChB,GAAG,KAAA;IACH,MAAM,KAAA;IACN,MAAM,KAAA;IACN,MAAM,KAAA;IACN,GAAG,KAAA;IACH,GAAG,KAAA;IACH,GAAG,KAAA;IACH,GAAG,KAAA;IACH,KAAK,KAAA;IACL,GAAG,KAAA;IACH,IAAI,KAAA;IACJ,QAAQ,KAAA;IACR,QAAQ,KAAA;IACR,MAAM,KAAA;IACN,MAAM,KAAA;IACN,KAAK,KAAA;IACL,MAAM,KAAA;IACN,UAAU,KAAA;IACV,kBAAkB,KAAA;CACnB;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,EAAE,CAAC;IAClD,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,MAAM,EAAE,CAAC;IACjD,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;IAGvC,aAAa,EAAE,MAAM;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5D"}
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasVariableNode = exports.NodeType = void 0;
4
- const functionNode_1 = require("./functions/functionNode");
5
- const operatorNode_1 = require("./operators/operatorNode");
6
- const variableNode_1 = require("./variables/variableNode");
3
+ exports.NodeIds = exports.NodeType = void 0;
7
4
  var NodeType;
8
5
  (function (NodeType) {
9
6
  NodeType[NodeType["number"] = 0] = "number";
@@ -11,21 +8,52 @@ var NodeType;
11
8
  NodeType[NodeType["variable"] = 2] = "variable";
12
9
  NodeType[NodeType["operator"] = 3] = "operator";
13
10
  NodeType[NodeType["function"] = 4] = "function";
14
- NodeType[NodeType["set"] = 5] = "set";
15
- NodeType[NodeType["inequation"] = 6] = "inequation";
16
- NodeType[NodeType["point"] = 7] = "point";
17
- NodeType[NodeType["mesure"] = 8] = "mesure";
18
- NodeType[NodeType["equality"] = 9] = "equality";
19
- NodeType[NodeType["belongs"] = 10] = "belongs";
20
- NodeType[NodeType["vector"] = 11] = "vector";
11
+ NodeType[NodeType["inequation"] = 5] = "inequation";
12
+ NodeType[NodeType["point"] = 6] = "point";
13
+ NodeType[NodeType["mesure"] = 7] = "mesure";
14
+ NodeType[NodeType["equality"] = 8] = "equality";
15
+ NodeType[NodeType["belongs"] = 9] = "belongs";
16
+ NodeType[NodeType["vector"] = 10] = "vector";
17
+ NodeType[NodeType["set"] = 11] = "set";
21
18
  })(NodeType || (exports.NodeType = NodeType = {}));
22
- const hasVariableNode = (n) => {
23
- if ((0, variableNode_1.isVariableNode)(n))
24
- return true;
25
- if ((0, operatorNode_1.isOperatorNode)(n))
26
- return (0, exports.hasVariableNode)(n.leftChild) || (0, exports.hasVariableNode)(n.rightChild);
27
- if ((0, functionNode_1.isFunctionNode)(n))
28
- return (0, exports.hasVariableNode)(n.child);
29
- return false;
30
- };
31
- exports.hasVariableNode = hasVariableNode;
19
+ var NodeIds;
20
+ (function (NodeIds) {
21
+ NodeIds[NodeIds["add"] = 0] = "add";
22
+ NodeIds[NodeIds["substract"] = 1] = "substract";
23
+ NodeIds[NodeIds["multiply"] = 2] = "multiply";
24
+ NodeIds[NodeIds["fraction"] = 3] = "fraction";
25
+ NodeIds[NodeIds["divide"] = 4] = "divide";
26
+ NodeIds[NodeIds["power"] = 5] = "power";
27
+ NodeIds[NodeIds["limit"] = 6] = "limit";
28
+ NodeIds[NodeIds["number"] = 7] = "number";
29
+ NodeIds[NodeIds["percent"] = 8] = "percent";
30
+ NodeIds[NodeIds["constant"] = 9] = "constant";
31
+ NodeIds[NodeIds["variable"] = 10] = "variable";
32
+ NodeIds[NodeIds["belongs"] = 11] = "belongs";
33
+ NodeIds[NodeIds["discreteSet"] = 12] = "discreteSet";
34
+ NodeIds[NodeIds["interval"] = 13] = "interval";
35
+ NodeIds[NodeIds["union"] = 14] = "union";
36
+ NodeIds[NodeIds["complex"] = 15] = "complex";
37
+ NodeIds[NodeIds["equal"] = 16] = "equal";
38
+ NodeIds[NodeIds["multiEqual"] = 17] = "multiEqual";
39
+ NodeIds[NodeIds["equationSolution"] = 18] = "equationSolution";
40
+ NodeIds[NodeIds["abs"] = 19] = "abs";
41
+ NodeIds[NodeIds["arccos"] = 20] = "arccos";
42
+ NodeIds[NodeIds["arcsin"] = 21] = "arcsin";
43
+ NodeIds[NodeIds["arctan"] = 22] = "arctan";
44
+ NodeIds[NodeIds["cos"] = 23] = "cos";
45
+ NodeIds[NodeIds["sin"] = 24] = "sin";
46
+ NodeIds[NodeIds["tan"] = 25] = "tan";
47
+ NodeIds[NodeIds["log"] = 26] = "log";
48
+ NodeIds[NodeIds["log10"] = 27] = "log10";
49
+ NodeIds[NodeIds["exp"] = 28] = "exp";
50
+ NodeIds[NodeIds["sqrt"] = 29] = "sqrt";
51
+ NodeIds[NodeIds["integral"] = 30] = "integral";
52
+ NodeIds[NodeIds["opposite"] = 31] = "opposite";
53
+ NodeIds[NodeIds["degree"] = 32] = "degree";
54
+ NodeIds[NodeIds["length"] = 33] = "length";
55
+ NodeIds[NodeIds["point"] = 34] = "point";
56
+ NodeIds[NodeIds["vector"] = 35] = "vector";
57
+ NodeIds[NodeIds["inequation"] = 36] = "inequation";
58
+ NodeIds[NodeIds["inequationSolution"] = 37] = "inequationSolution";
59
+ })(NodeIds || (exports.NodeIds = NodeIds = {}));
@@ -0,0 +1,7 @@
1
+ import { Node, NodeIds } from "./node";
2
+ export declare abstract class NodeConstructor {
3
+ static fromIdentifiers(identifiers: {
4
+ id: NodeIds;
5
+ } & Record<string, any>): Node;
6
+ }
7
+ //# sourceMappingURL=nodeConstructor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeConstructor.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/nodeConstructor.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAkBvC,8BAAsB,eAAe;IACnC,MAAM,CAAC,eAAe,CACpB,WAAW,EAAE;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjD,IAAI;CAwQR"}