pimath 0.0.49 → 0.0.53

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 (127) hide show
  1. package/README.md +1 -1
  2. package/dist/pi.js +626 -358
  3. package/dist/pi.js.map +1 -1
  4. package/dist/pi.min.js +1 -1
  5. package/dist/pi.min.js.map +1 -1
  6. package/docs/assets/highlight.css +78 -78
  7. package/docs/assets/icons.css +1043 -1043
  8. package/docs/assets/main.js +52 -52
  9. package/docs/assets/search.js +1 -1
  10. package/docs/assets/style.css +1413 -1388
  11. package/docs/classes/Logicalset.Logicalset-1.html +5 -0
  12. package/docs/classes/Polynom.Rational.html +4 -0
  13. package/docs/classes/Vector.Point.html +1 -0
  14. package/docs/classes/Vector.Vector-1.html +1 -0
  15. package/docs/classes/algebra_equation.Equation.html +26 -0
  16. package/docs/classes/algebra_linearSystem.LinearSystem.html +1 -0
  17. package/docs/classes/algebra_monom.Monom.html +114 -0
  18. package/docs/classes/algebra_polynom.Polynom.html +30 -0
  19. package/docs/classes/coefficients_fraction.Fraction.html +19 -0
  20. package/docs/classes/coefficients_nthroot.NthRoot.html +3 -0
  21. package/docs/classes/expressions_numexp.NumExp.html +1 -0
  22. package/docs/classes/expressions_polynomexp.PolynomExpFactor.html +1 -0
  23. package/docs/classes/expressions_polynomexp.PolynomExpProduct.html +1 -0
  24. package/docs/classes/geometry_circle.Circle.html +3 -0
  25. package/docs/classes/geometry_line.Line.html +3 -0
  26. package/docs/classes/geometry_triangle.Triangle.html +17 -0
  27. package/docs/classes/numeric.Numeric.html +14 -14
  28. package/docs/classes/shutingyard.Shutingyard.html +18 -18
  29. package/docs/enums/algebra_equation.PARTICULAR_SOLUTION.html +1 -0
  30. package/docs/enums/geometry_line.LinePropriety.html +1 -0
  31. package/docs/enums/shutingyard.ShutingyardMode.html +1 -1
  32. package/docs/enums/shutingyard.ShutingyardType.html +1 -1
  33. package/docs/index.html +11 -11
  34. package/docs/interfaces/algebra_equation.ISolution.html +3 -0
  35. package/docs/interfaces/geometry_triangle.remarquableLines.html +1 -0
  36. package/docs/modules/Logicalset.html +3 -0
  37. package/docs/modules/Polynom.html +3 -0
  38. package/docs/modules/Vector.html +3 -0
  39. package/docs/modules/algebra_equation.html +1 -0
  40. package/docs/modules/algebra_linearSystem.html +1 -0
  41. package/docs/modules/algebra_monom.html +1 -0
  42. package/docs/modules/algebra_polynom.html +1 -0
  43. package/docs/modules/coefficients_fraction.html +1 -0
  44. package/docs/modules/coefficients_nthroot.html +1 -0
  45. package/docs/modules/expressions_numexp.html +1 -0
  46. package/docs/modules/expressions_polynomexp.html +1 -0
  47. package/docs/modules/geometry_circle.html +1 -0
  48. package/docs/modules/geometry_line.html +1 -0
  49. package/docs/modules/geometry_triangle.html +1 -0
  50. package/docs/modules/numeric.html +1 -1
  51. package/docs/modules/shutingyard.html +1 -1
  52. package/docs/modules.html +1 -1
  53. package/esm/index.d.ts +2 -2
  54. package/esm/index.js +2 -2
  55. package/esm/maths/algebra/equation.d.ts +7 -2
  56. package/esm/maths/algebra/equation.js +62 -19
  57. package/esm/maths/algebra/equation.js.map +10 -1
  58. package/esm/maths/algebra/linearSystem.js +1 -1
  59. package/esm/maths/algebra/linearSystem.js.map +10 -1
  60. package/esm/maths/algebra/monom.js +2 -2
  61. package/esm/maths/algebra/monom.js.map +10 -1
  62. package/esm/maths/algebra/polynom.d.ts +5 -1
  63. package/esm/maths/algebra/polynom.js +157 -81
  64. package/esm/maths/algebra/polynom.js.map +1 -1
  65. package/esm/maths/algebra/rational.d.ts +16 -6
  66. package/esm/maths/algebra/rational.js +139 -30
  67. package/esm/maths/algebra/rational.js.map +10 -1
  68. package/esm/maths/coefficients/fraction.d.ts +3 -1
  69. package/esm/maths/coefficients/fraction.js +37 -5
  70. package/esm/maths/coefficients/fraction.js.map +1 -1
  71. package/esm/maths/coefficients/{nthroot.d.ts → nthRoot.d.ts} +5 -5
  72. package/esm/maths/coefficients/{nthroot.js → nthRoot.js} +5 -5
  73. package/esm/maths/coefficients/{nthroot.js.map → nthRoot.js.map} +1 -1
  74. package/esm/maths/expressions/polynomexp.bkp.js +2 -3
  75. package/esm/maths/expressions/polynomexp.bkp.js.map +10 -1
  76. package/esm/maths/expressions/polynomexp.js +3 -3
  77. package/esm/maths/expressions/polynomexp.js.map +10 -1
  78. package/esm/maths/geometry/line.js +8 -0
  79. package/esm/maths/geometry/line.js.map +1 -1
  80. package/esm/maths/geometry/point.js +1 -1
  81. package/esm/maths/geometry/point.js.map +10 -1
  82. package/esm/maths/randomization/random.js +5 -1
  83. package/esm/maths/randomization/random.js.map +10 -1
  84. package/package.json +11 -11
  85. package/public/index.html +234 -235
  86. package/src/index.ts +2 -2
  87. package/src/maths/algebra/equation.ts +68 -19
  88. package/src/maths/algebra/linearSystem.ts +1 -1
  89. package/src/maths/algebra/monom.ts +3 -4
  90. package/src/maths/algebra/polynom.ts +170 -87
  91. package/src/maths/algebra/rational.ts +243 -98
  92. package/src/maths/coefficients/fraction.ts +44 -6
  93. package/src/maths/coefficients/{nthroot.ts → nthRoot.ts} +5 -5
  94. package/src/maths/expressions/polynomexp.bkp.ts +1 -2
  95. package/src/maths/expressions/polynomexp.ts +2 -1
  96. package/src/maths/geometry/line.ts +0 -1
  97. package/src/maths/geometry/point.ts +1 -1
  98. package/tests/algebra/equation.test.ts +36 -0
  99. package/tests/algebra/monom.test.ts +2 -5
  100. package/tests/algebra/polynom.test.ts +7 -3
  101. package/tests/algebra/rationnal.test.ts +96 -0
  102. package/tests/coefficients/fraction.test.ts +43 -1
  103. package/tests/geometry/circle.test.ts +4 -2
  104. package/tests/polynomexp.test.ts +0 -3
  105. package/tsconfig.json +16 -5
  106. package/docs/classes/Algebra.Equation.html +0 -26
  107. package/docs/classes/algebra.LinearSystem.html +0 -1
  108. package/docs/classes/algebra.Logicalset.html +0 -5
  109. package/docs/classes/algebra.Monom.html +0 -114
  110. package/docs/classes/algebra.Polynom.html +0 -30
  111. package/docs/classes/algebra.PolynomExpFactor.html +0 -1
  112. package/docs/classes/algebra.PolynomExpProduct.html +0 -1
  113. package/docs/classes/algebra.Rational.html +0 -4
  114. package/docs/classes/coefficients.Fraction.html +0 -19
  115. package/docs/classes/coefficients.Nthroot.html +0 -3
  116. package/docs/classes/geometry.Circle.html +0 -3
  117. package/docs/classes/geometry.Line.html +0 -3
  118. package/docs/classes/geometry.Point.html +0 -1
  119. package/docs/classes/geometry.Triangle.html +0 -17
  120. package/docs/classes/geometry.Vector.html +0 -1
  121. package/docs/enums/geometry.LinePropriety.html +0 -1
  122. package/docs/interfaces/geometry.remarquableLines.html +0 -1
  123. package/docs/modules/Algebra.html +0 -1
  124. package/docs/modules/Random.html +0 -1
  125. package/docs/modules/coefficients.html +0 -1
  126. package/docs/modules/geometry.html +0 -1
  127. package/docs/modules/random.Random.html +0 -1
package/public/index.html CHANGED
@@ -49,32 +49,31 @@
49
49
  let triplets = []
50
50
  let n = 9, v
51
51
 
52
- for(let u = 2; u<=n; u++){
53
- v = ( u%2===0 )?1:2
54
- while(v < u){
55
- if(Pi.Numeric.gcd(u, v)===1){
52
+ for (let u = 2; u <= n; u++) {
53
+ v = (u % 2 === 0) ? 1 : 2
54
+ while (v < u) {
55
+ if (Pi.Numeric.gcd(u, v) === 1) {
56
56
  triplets.push([
57
57
  u, v,
58
- u**2-v**2,
59
- 2*u*v,
60
- u**2+v**2
58
+ u ** 2 - v ** 2,
59
+ 2 * u * v,
60
+ u ** 2 + v ** 2
61
61
  ])
62
62
  }
63
- v = v + 2
63
+ v = v + 2
64
64
  }
65
65
  }
66
66
 
67
67
  let target = 13
68
68
  // Filtrer les triplets pour n'avoir que les valeurs 15.
69
- triplets = triplets.filter(x=>x[x.length-1]===target)
70
-
69
+ triplets = triplets.filter(x => x[x.length - 1] === target)
71
70
 
72
71
 
73
72
  // méthode inverse, à partir du triplet.
74
73
  triplets = []
75
- for(let u = 0; u <= target; u++){
76
- for(let v = 0; v <=target; v++){
77
- if(u**2+v**2===target**2){
74
+ for (let u = 0; u <= target; u++) {
75
+ for (let v = 0; v <= target; v++) {
76
+ if (u ** 2 + v ** 2 === target ** 2) {
78
77
  triplets.push([u, v, target])
79
78
  }
80
79
  }
@@ -86,228 +85,228 @@
86
85
  }
87
86
 
88
87
 
89
- // Should be
90
- function examplePolynomExpSimple () {
91
- const F1 = new Pi.PolynomExpFactor('x^2-4x+7', -1),
92
- F2 = new Pi.PolynomExpFactor('8x-16', 1),
93
- PP = new Pi.PolynomExpProduct(F2, F1)
94
-
95
- const D = F1.derivative()
96
- D.reduce()
97
-
98
- console.log(PP.integrate())
99
- return {
100
- d: katex.renderToString('\\left(' + F1.tex + '\\right)\'=' + D.tex),
101
- i: katex.renderToString('\\displaystyle\\int\\ ' + PP.tex + '\\ \\text{d}x = ' + PP.integrate().tex)
102
- }
103
- }
104
-
105
- function example () {
106
- let P = new Pi.Polynom('3x^(2/3)-5x+5/3')
107
-
108
- console.log(P.tex)
109
-
110
- return {
111
- tex: katex.renderToString(P.tex)
112
- }
113
- }
114
-
115
- // let ne = new Pi.NumExp('5/x*sin(x*x)')
116
- // const expr2 = new Pi.NumExp('-3*x^2-5')
117
- //
118
- // console.log(expr2.evaluate({x: -2}))
119
- //
120
- //
121
- // let ne = new Pi.NumExp('5/x*sqrt(x^2)')
122
- //
123
- // console.log(ne.rpn)
124
- // console.log(ne.evaluate({x: 0}))
125
-
126
- function dev () {
127
- let output = []
128
-
129
- ex1()
130
- // ex1()
131
- // console.log(ex1())
132
- output = [
133
- '\\text{exercice 1}',
134
- ...ex1(),
135
- '--------------',
136
- '\\text{exercice 2}',
137
- ...ex2(),
138
- '--------------',
139
- '\\text{exercice 3}',
140
- ...ex3(),
141
- '--------------',
142
- '\\text{exercice 4}',
143
- ...ex4()]
144
-
145
- // console.log(ex1())
146
- return {
147
- output
148
- }
149
- }
150
-
151
- function ex1 () {
152
- // EXERCICE 1
153
- let cart = [
154
- 'A',
155
- 'x^2-10x+y^2-8y+37=0',
156
- 'x^2-4x+y^2+6y+20=0',
157
- '3x^2+3y^2+18y+3=0',
158
- '4x^2-16x+8y^2-16y-10=0',
159
- 'B',
160
- 'x^2+10x+y^2-8y+32=0',
161
- '5x^2+5y^2+80y+45=0',
162
- '3x^2-9x+5y^2-10y+45=0',
163
- 'x^2-8x+y^2+4x+36=0'
164
- ], C, texData = []
165
-
166
- for (let equ of cart) {
167
- if (equ.length === 1) {
168
- texData.push(`\\text{série ${equ}}`)
169
- continue
170
- }
171
- C = new Pi.Geometry.Circle(equ)
172
- if (C.exists) {
173
- texData.push(equ + '\\implies ' + C.tex + '\\implies C' + C.center.tex + ',\\ r=' + C.radius.tex)
174
- } else {
175
- texData.push(equ + '\\implies' + '\\text{pas un cercle}')
176
- }
177
- }
178
-
179
- return texData
180
- }
181
-
182
- function ex2 () {
183
- let Center1 = new Pi.Geometry.Point(4, -2),
184
- C1 = new Pi.Geometry.Circle(Center1, 10, true),
185
- droites1 = [
186
- 'x+3y-8=0',
187
- 'x-6y+6=0',
188
- '2x+y-1=0',
189
- '3x-4y-36=0'
190
- ],
191
- Center2 = new Pi.Geometry.Point(8, 6),
192
- C2 = new Pi.Geometry.Circle(
193
- Center2,
194
- 40,
195
- true),
196
- droites2 = [
197
- 'x-3y+30=0',
198
- '4x+11y-22=0',
199
- '3x-y+8=0',
200
- '2x+y-32=0'
201
- ],
202
- d, pr, out = []
203
-
204
- out.push('\\text{série A}')
205
- out.push('(\\Gamma_1):' + C1.tex)
206
- for (let equ of droites1) {
207
- d = new Pi.Geometry.Line(equ)
208
- pr = C1.relativePosition(d)
209
-
210
- if (pr === 0) {
211
- out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C1.center).tex + '\\implies \\text{externe}\\ ')
212
- } else if (pr === 1) {
213
- out.push(d.tex.canonical + '\\implies \\text{tangent: }' + C1.lineIntersection(d)[0].tex)
214
- } else {
215
- out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C1.center).tex + '\\implies \\text{sécant:}\\ ' + C1.lineIntersection(d).map(x => x.tex).join('\\quad'))
216
- }
217
- }
218
-
219
- out.push('\\text{série B}')
220
- out.push('(\\Gamma_2):' + C2.tex)
221
- for (let equ of droites2) {
222
- d = new Pi.Geometry.Line(equ)
223
- pr = C2.relativePosition(d)
224
- if (pr === 0) {
225
- out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C2.center).tex + '\\implies \\text{externe}')
226
- } else if (pr === 1) {
227
- out.push(d.tex.canonical + '\\implies \\text{tangent: }' + C2.lineIntersection(d)[0].tex)
228
- } else {
229
- out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C2.center).tex + '\\implies \\text{sécant:} ' + C2.lineIntersection(d).map(x => x.tex).join('\\quad'))
230
- }
231
- }
232
-
233
- return out
234
- }
235
-
236
- function ex3 () {
237
- let C = new Pi.Geometry.Circle(
238
- new Pi.Geometry.Point(-14, 18),
239
- new Pi.Geometry.Point(-2, 14),
240
- new Pi.Geometry.Point(-10, 22)
241
- ), T1 = new Pi.Geometry.Triangle(new Pi.Geometry.Point(-14, 18),
242
- new Pi.Geometry.Point(-2, 14),
243
- new Pi.Geometry.Point(-10, 22))
244
-
245
- let E = new Pi.Geometry.Circle(
246
- new Pi.Geometry.Point(4, 10),
247
- new Pi.Geometry.Point(5, 5),
248
- new Pi.Geometry.Point(9, 11)
249
- ), T2 = new Pi.Geometry.Triangle(
250
- new Pi.Geometry.Point(4, 10),
251
- new Pi.Geometry.Point(5, 5),
252
- new Pi.Geometry.Point(9, 11)
253
- )
254
-
255
- return [
256
- '\\text{2 milieux, 2 normales, 2 médiatrices, 2 intersection, 1 rayon, 1 équation}',
257
- '\\text{série A}',
258
- (new Pi.Geometry.Point().middleOf(T2.A, T2.B)).tex + '\\quad (m_{AB}):\\ ' + T2.remarquables.mediators.AB.tex.canonical,
259
- (new Pi.Geometry.Point().middleOf(T2.A, T2.C)).tex + '\\quad (m_{AC}):\\ ' + T2.remarquables.mediators.AC.tex.canonical,
260
- (new Pi.Geometry.Point().middleOf(T2.C, T2.B)).tex + '\\quad (m_{BC}):\\ ' + T2.remarquables.mediators.BC.tex.canonical,
261
- E.tex,
262
- '\\text{série B}',
263
- (new Pi.Geometry.Point().middleOf(T1.A, T1.B)).tex + '\\quad (m_{AB}):\\ ' + T1.remarquables.mediators.AB.tex.canonical,
264
- (new Pi.Geometry.Point().middleOf(T1.A, T1.C)).tex + '\\quad (m_{AC}):\\ ' + T1.remarquables.mediators.AC.tex.canonical,
265
- (new Pi.Geometry.Point().middleOf(T1.C, T1.B)).tex + '\\quad (m_{BC}):\\ ' + T1.remarquables.mediators.BC.tex.canonical,
266
- C.tex,
267
-
268
- ]
269
- }
270
-
271
- function ex4 () {
272
- // A
273
- let A = new Pi.Geometry.Point(-6, -9),
274
- C = new Pi.Geometry.Circle('(x+3)^2+(y+5)^2=25'),
275
- Oy = C.cartesian.clone().replaceBy('x', new Pi.Polynom().zero()),
276
- Ox = C.cartesian.clone().replaceBy('y', new Pi.Polynom().zero()),
277
- t = new Pi.Geometry.Line(
278
- A,
279
- new Pi.Geometry.Vector(A, C.center),
280
- Pi.Geometry.Line.PERPENDICULAR
281
- )
282
-
283
- Oy.solve()
284
- Ox.solve()
285
-
286
- // B
287
- let A1 = new Pi.Geometry.Point(-4, -14),
288
- C1 = new Pi.Geometry.Circle('(x-10)^2+(y+6)^2=100'),
289
- Oy1 = C1.cartesian.clone().replaceBy('x', new Pi.Polynom().zero()),
290
- Ox1 = C1.cartesian.clone().replaceBy('y', new Pi.Polynom().zero()),
291
- t1 = new Pi.Geometry.Line(
292
- A1,
293
- new Pi.Geometry.Vector(A1, C1.center),
294
- Pi.Geometry.Line.PERPENDICULAR
295
- )
296
-
297
- Oy1.solve()
298
- Ox1.solve()
299
-
300
- return [
301
- '\\text{série A}',
302
- '(Ox):\\ ' + Ox.solutions.map(y => `(${y.value};0)`),
303
- '(Oy):\\ ' + Oy.solutions.map(x => `(0;${x.value})`),
304
- '(t):\\ ' + t.tex.canonical,
305
- '\\text{série B}',
306
- '(Ox):\\ ' + Ox1.solutions.map(y => `(${y.value};0)`),
307
- '(Oy):\\ ' + Oy1.solutions.map(x => `(0;${x.value})`),
308
- '(t):\\ ' + t1.tex.canonical
309
- ]
310
- }
88
+ // Should be
89
+ function examplePolynomExpSimple() {
90
+ const F1 = new Pi.PolynomExpFactor('x^2-4x+7', -1),
91
+ F2 = new Pi.PolynomExpFactor('8x-16', 1),
92
+ PP = new Pi.PolynomExpProduct(F2, F1)
93
+
94
+ const D = F1.derivative()
95
+ D.reduce()
96
+
97
+ console.log(PP.integrate())
98
+ return {
99
+ d: katex.renderToString('\\left(' + F1.tex + '\\right)\'=' + D.tex),
100
+ i: katex.renderToString('\\displaystyle\\int\\ ' + PP.tex + '\\ \\text{d}x = ' + PP.integrate().tex)
101
+ }
102
+ }
103
+
104
+ function example() {
105
+ let P = new Pi.Polynom('3x^(2/3)-5x+5/3')
106
+
107
+ console.log(P.tex)
108
+
109
+ return {
110
+ tex: katex.renderToString(P.tex)
111
+ }
112
+ }
113
+
114
+ // let ne = new Pi.NumExp('5/x*sin(x*x)')
115
+ // const expr2 = new Pi.NumExp('-3*x^2-5')
116
+ //
117
+ // console.log(expr2.evaluate({x: -2}))
118
+ //
119
+ //
120
+ // let ne = new Pi.NumExp('5/x*sqrt(x^2)')
121
+ //
122
+ // console.log(ne.rpn)
123
+ // console.log(ne.evaluate({x: 0}))
124
+
125
+ function dev() {
126
+ let output = []
127
+
128
+ ex1()
129
+ // ex1()
130
+ // console.log(ex1())
131
+ output = [
132
+ '\\text{exercice 1}',
133
+ ...ex1(),
134
+ '--------------',
135
+ '\\text{exercice 2}',
136
+ ...ex2(),
137
+ '--------------',
138
+ '\\text{exercice 3}',
139
+ ...ex3(),
140
+ '--------------',
141
+ '\\text{exercice 4}',
142
+ ...ex4()]
143
+
144
+ // console.log(ex1())
145
+ return {
146
+ output
147
+ }
148
+ }
149
+
150
+ function ex1() {
151
+ // EXERCICE 1
152
+ let cart = [
153
+ 'A',
154
+ 'x^2-10x+y^2-8y+37=0',
155
+ 'x^2-4x+y^2+6y+20=0',
156
+ '3x^2+3y^2+18y+3=0',
157
+ '4x^2-16x+8y^2-16y-10=0',
158
+ 'B',
159
+ 'x^2+10x+y^2-8y+32=0',
160
+ '5x^2+5y^2+80y+45=0',
161
+ '3x^2-9x+5y^2-10y+45=0',
162
+ 'x^2-8x+y^2+4x+36=0'
163
+ ], C, texData = []
164
+
165
+ for (let equ of cart) {
166
+ if (equ.length === 1) {
167
+ texData.push(`\\text{série ${equ}}`)
168
+ continue
169
+ }
170
+ C = new Pi.Geometry.Circle(equ)
171
+ if (C.exists) {
172
+ texData.push(equ + '\\implies ' + C.tex + '\\implies C' + C.center.tex + ',\\ r=' + C.radius.tex)
173
+ } else {
174
+ texData.push(equ + '\\implies' + '\\text{pas un cercle}')
175
+ }
176
+ }
177
+
178
+ return texData
179
+ }
180
+
181
+ function ex2() {
182
+ let Center1 = new Pi.Geometry.Point(4, -2),
183
+ C1 = new Pi.Geometry.Circle(Center1, 10, true),
184
+ droites1 = [
185
+ 'x+3y-8=0',
186
+ 'x-6y+6=0',
187
+ '2x+y-1=0',
188
+ '3x-4y-36=0'
189
+ ],
190
+ Center2 = new Pi.Geometry.Point(8, 6),
191
+ C2 = new Pi.Geometry.Circle(
192
+ Center2,
193
+ 40,
194
+ true),
195
+ droites2 = [
196
+ 'x-3y+30=0',
197
+ '4x+11y-22=0',
198
+ '3x-y+8=0',
199
+ '2x+y-32=0'
200
+ ],
201
+ d, pr, out = []
202
+
203
+ out.push('\\text{série A}')
204
+ out.push('(\\Gamma_1):' + C1.tex)
205
+ for (let equ of droites1) {
206
+ d = new Pi.Geometry.Line(equ)
207
+ pr = C1.relativePosition(d)
208
+
209
+ if (pr === 0) {
210
+ out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C1.center).tex + '\\implies \\text{externe}\\ ')
211
+ } else if (pr === 1) {
212
+ out.push(d.tex.canonical + '\\implies \\text{tangent: }' + C1.lineIntersection(d)[0].tex)
213
+ } else {
214
+ out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C1.center).tex + '\\implies \\text{sécant:}\\ ' + C1.lineIntersection(d).map(x => x.tex).join('\\quad'))
215
+ }
216
+ }
217
+
218
+ out.push('\\text{série B}')
219
+ out.push('(\\Gamma_2):' + C2.tex)
220
+ for (let equ of droites2) {
221
+ d = new Pi.Geometry.Line(equ)
222
+ pr = C2.relativePosition(d)
223
+ if (pr === 0) {
224
+ out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C2.center).tex + '\\implies \\text{externe}')
225
+ } else if (pr === 1) {
226
+ out.push(d.tex.canonical + '\\implies \\text{tangent: }' + C2.lineIntersection(d)[0].tex)
227
+ } else {
228
+ out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C2.center).tex + '\\implies \\text{sécant:} ' + C2.lineIntersection(d).map(x => x.tex).join('\\quad'))
229
+ }
230
+ }
231
+
232
+ return out
233
+ }
234
+
235
+ function ex3() {
236
+ let C = new Pi.Geometry.Circle(
237
+ new Pi.Geometry.Point(-14, 18),
238
+ new Pi.Geometry.Point(-2, 14),
239
+ new Pi.Geometry.Point(-10, 22)
240
+ ), T1 = new Pi.Geometry.Triangle(new Pi.Geometry.Point(-14, 18),
241
+ new Pi.Geometry.Point(-2, 14),
242
+ new Pi.Geometry.Point(-10, 22))
243
+
244
+ let E = new Pi.Geometry.Circle(
245
+ new Pi.Geometry.Point(4, 10),
246
+ new Pi.Geometry.Point(5, 5),
247
+ new Pi.Geometry.Point(9, 11)
248
+ ), T2 = new Pi.Geometry.Triangle(
249
+ new Pi.Geometry.Point(4, 10),
250
+ new Pi.Geometry.Point(5, 5),
251
+ new Pi.Geometry.Point(9, 11)
252
+ )
253
+
254
+ return [
255
+ '\\text{2 milieux, 2 normales, 2 médiatrices, 2 intersection, 1 rayon, 1 équation}',
256
+ '\\text{série A}',
257
+ (new Pi.Geometry.Point().middleOf(T2.A, T2.B)).tex + '\\quad (m_{AB}):\\ ' + T2.remarquables.mediators.AB.tex.canonical,
258
+ (new Pi.Geometry.Point().middleOf(T2.A, T2.C)).tex + '\\quad (m_{AC}):\\ ' + T2.remarquables.mediators.AC.tex.canonical,
259
+ (new Pi.Geometry.Point().middleOf(T2.C, T2.B)).tex + '\\quad (m_{BC}):\\ ' + T2.remarquables.mediators.BC.tex.canonical,
260
+ E.tex,
261
+ '\\text{série B}',
262
+ (new Pi.Geometry.Point().middleOf(T1.A, T1.B)).tex + '\\quad (m_{AB}):\\ ' + T1.remarquables.mediators.AB.tex.canonical,
263
+ (new Pi.Geometry.Point().middleOf(T1.A, T1.C)).tex + '\\quad (m_{AC}):\\ ' + T1.remarquables.mediators.AC.tex.canonical,
264
+ (new Pi.Geometry.Point().middleOf(T1.C, T1.B)).tex + '\\quad (m_{BC}):\\ ' + T1.remarquables.mediators.BC.tex.canonical,
265
+ C.tex,
266
+
267
+ ]
268
+ }
269
+
270
+ function ex4() {
271
+ // A
272
+ let A = new Pi.Geometry.Point(-6, -9),
273
+ C = new Pi.Geometry.Circle('(x+3)^2+(y+5)^2=25'),
274
+ Oy = C.cartesian.clone().replaceBy('x', new Pi.Polynom().zero()),
275
+ Ox = C.cartesian.clone().replaceBy('y', new Pi.Polynom().zero()),
276
+ t = new Pi.Geometry.Line(
277
+ A,
278
+ new Pi.Geometry.Vector(A, C.center),
279
+ Pi.Geometry.Line.PERPENDICULAR
280
+ )
281
+
282
+ Oy.solve()
283
+ Ox.solve()
284
+
285
+ // B
286
+ let A1 = new Pi.Geometry.Point(-4, -14),
287
+ C1 = new Pi.Geometry.Circle('(x-10)^2+(y+6)^2=100'),
288
+ Oy1 = C1.cartesian.clone().replaceBy('x', new Pi.Polynom().zero()),
289
+ Ox1 = C1.cartesian.clone().replaceBy('y', new Pi.Polynom().zero()),
290
+ t1 = new Pi.Geometry.Line(
291
+ A1,
292
+ new Pi.Geometry.Vector(A1, C1.center),
293
+ Pi.Geometry.Line.PERPENDICULAR
294
+ )
295
+
296
+ Oy1.solve()
297
+ Ox1.solve()
298
+
299
+ return [
300
+ '\\text{série A}',
301
+ '(Ox):\\ ' + Ox.solutions.map(y => `(${y.value};0)`),
302
+ '(Oy):\\ ' + Oy.solutions.map(x => `(0;${x.value})`),
303
+ '(t):\\ ' + t.tex.canonical,
304
+ '\\text{série B}',
305
+ '(Ox):\\ ' + Ox1.solutions.map(y => `(${y.value};0)`),
306
+ '(Oy):\\ ' + Oy1.solutions.map(x => `(0;${x.value})`),
307
+ '(t):\\ ' + t1.tex.canonical
308
+ ]
309
+ }
311
310
 
312
311
  </script>
313
312
  </body>
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@ import {NumExp} from "./maths/expressions/numexp";
3
3
  import {Shutingyard} from "./maths/shutingyard";
4
4
  import {Random} from "./maths/randomization/random";
5
5
  import {Fraction} from "./maths/coefficients/fraction";
6
- import {Nthroot} from "./maths/coefficients/nthroot";
6
+ import {NthRoot} from "./maths/coefficients/nthRoot";
7
7
  import {Monom} from "./maths/algebra/monom";
8
8
  import {Polynom} from "./maths/algebra/polynom";
9
9
  import {Equation} from "./maths/algebra/equation";
@@ -23,7 +23,7 @@ export const PiMath = {
23
23
  Numeric: Numeric,
24
24
  NumExp: NumExp,
25
25
  Fraction: Fraction,
26
- Root: Nthroot,
26
+ Root: NthRoot,
27
27
  Monom: Monom,
28
28
  Polynom: Polynom,
29
29
  Equation: Equation,