pimath 0.0.22 → 0.0.26
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/dev/demo.css +3 -0
- package/dev/index.html +216 -53
- package/dev/pi.js +356 -126
- package/dev/pi.js.map +1 -1
- package/dist/pi.js +1 -1
- package/dist/pi.js.map +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/algebra.Equation.html +11 -13
- package/docs/classes/algebra.LinearSystem.html +1 -1
- package/docs/classes/algebra.Logicalset.html +3 -3
- package/docs/classes/algebra.Monom.html +42 -42
- package/docs/classes/algebra.Polynom.html +12 -25
- package/docs/classes/algebra.Rational.html +3 -3
- package/docs/classes/coefficients.Fraction.html +10 -6
- package/docs/classes/coefficients.Nthroot.html +3 -1
- package/docs/classes/geometry.Circle.html +3 -1
- package/docs/classes/geometry.Line.html +3 -1
- package/docs/classes/geometry.Point.html +1 -1
- package/docs/classes/geometry.Triangle.html +6 -6
- package/docs/classes/geometry.Vector.html +1 -1
- package/docs/classes/numeric.Numeric.html +5 -5
- package/docs/classes/shutingyard.Shutingyard.html +5 -5
- package/docs/index.html +1 -1
- package/docs/interfaces/geometry.remarquableLines.html +1 -1
- package/docs/modules/algebra.html +1 -1
- package/docs/modules/coefficients.html +1 -1
- package/docs/modules/geometry.html +1 -1
- package/docs/modules/numeric.html +1 -1
- package/docs/modules/random.Random.html +1 -1
- package/docs/modules/random.html +1 -1
- package/docs/modules/shutingyard.html +1 -1
- package/docs/modules.html +1 -1
- package/esm/maths/algebra/equation.d.ts +11 -5
- package/esm/maths/algebra/equation.js +159 -52
- package/esm/maths/algebra/equation.js.map +1 -1
- package/esm/maths/algebra/linearSystem.d.ts +3 -4
- package/esm/maths/algebra/linearSystem.js +2 -5
- package/esm/maths/algebra/linearSystem.js.map +1 -1
- package/esm/maths/algebra/logicalset.d.ts +2 -2
- package/esm/maths/algebra/logicalset.js.map +1 -1
- package/esm/maths/algebra/monom.d.ts +3 -2
- package/esm/maths/algebra/monom.js +22 -1
- package/esm/maths/algebra/monom.js.map +1 -1
- package/esm/maths/algebra/polynom.d.ts +6 -6
- package/esm/maths/algebra/polynom.js +4 -4
- package/esm/maths/algebra/polynom.js.map +1 -1
- package/esm/maths/coefficients/fraction.d.ts +2 -2
- package/esm/maths/coefficients/fraction.js +1 -1
- package/esm/maths/coefficients/fraction.js.map +1 -1
- package/esm/maths/coefficients/nthroot.d.ts +1 -1
- package/esm/maths/coefficients/nthroot.js +4 -1
- package/esm/maths/coefficients/nthroot.js.map +1 -1
- package/esm/maths/geometry/circle.d.ts +12 -3
- package/esm/maths/geometry/circle.js +125 -39
- package/esm/maths/geometry/circle.js.map +1 -1
- package/esm/maths/geometry/line.d.ts +1 -2
- package/esm/maths/geometry/line.js +3 -5
- package/esm/maths/geometry/line.js.map +1 -1
- package/esm/maths/geometry/point.d.ts +3 -4
- package/esm/maths/geometry/point.js +18 -15
- package/esm/maths/geometry/point.js.map +1 -1
- package/esm/maths/geometry/triangle.d.ts +0 -1
- package/esm/maths/geometry/triangle.js +3 -4
- package/esm/maths/geometry/triangle.js.map +1 -1
- package/esm/maths/geometry/vector.js +2 -1
- package/esm/maths/geometry/vector.js.map +1 -1
- package/esm/maths/random/rndFraction.js +4 -3
- package/esm/maths/random/rndFraction.js.map +1 -1
- package/esm/maths/random/rndMonom.d.ts +1 -1
- package/esm/maths/random/rndMonom.js +12 -7
- package/esm/maths/random/rndMonom.js.map +1 -1
- package/esm/maths/random/rndPolynom.js +8 -2
- package/esm/maths/random/rndPolynom.js.map +1 -1
- package/esm/maths/random/rndTypes.d.ts +3 -1
- package/package.json +3 -5
- package/src/maths/algebra/equation.ts +183 -73
- package/src/maths/algebra/linearSystem.ts +262 -265
- package/src/maths/algebra/logicalset.ts +1 -1
- package/src/maths/algebra/monom.ts +24 -18
- package/src/maths/algebra/polynom.ts +10 -10
- package/src/maths/coefficients/fraction.ts +11 -7
- package/src/maths/coefficients/nthroot.ts +8 -1
- package/src/maths/geometry/circle.ts +160 -45
- package/src/maths/geometry/line.ts +8 -10
- package/src/maths/geometry/point.ts +25 -18
- package/src/maths/geometry/triangle.ts +3 -5
- package/src/maths/geometry/vector.ts +4 -3
- package/src/maths/random/rndFraction.ts +4 -3
- package/src/maths/random/rndMonom.ts +39 -35
- package/src/maths/random/rndPolynom.ts +13 -3
- package/src/maths/random/rndTypes.ts +4 -2
- package/tests/algebra/monom.test.ts +18 -4
- package/tests/algebra/polynom.test.ts +19 -4
- package/tests/geometry/circle.test.ts +28 -0
- package/tsconfig.json +4 -1
- package/typedoc.katex.js +11 -0
- package/docs/classes/algebra.Algebra.Equation.html +0 -26
- package/docs/classes/algebra.Algebra.LinearSystem.html +0 -1
- package/docs/classes/algebra.Algebra.LogicalSet.html +0 -3
- package/docs/classes/algebra.Algebra.Monom.html +0 -111
- package/docs/classes/algebra.Algebra.Polynom.html +0 -36
- package/docs/classes/algebra.Algebra.Rational.html +0 -2
- package/docs/classes/geometry.Geometry.Circle.html +0 -1
- package/docs/classes/geometry.Geometry.Line.html +0 -1
- package/docs/classes/geometry.Geometry.Point.html +0 -1
- package/docs/classes/geometry.Geometry.Triangle.html +0 -9
- package/docs/classes/geometry.Geometry.Vector.html +0 -1
- package/docs/modules/algebra.Algebra.html +0 -1
- package/docs/modules/geometry.Geometry.html +0 -1
- package/src/maths/algebra/monom_bck.backup +0 -746
package/dev/demo.css
ADDED
package/dev/index.html
CHANGED
|
@@ -1,67 +1,230 @@
|
|
|
1
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="fr">
|
|
2
3
|
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
6
|
<title>Getting Started</title>
|
|
7
|
+
|
|
4
8
|
<script src="pi.js"></script>
|
|
9
|
+
|
|
10
|
+
<!-- Alpine -->
|
|
11
|
+
<script src="//unpkg.com/alpinejs" defer></script>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
<!-- KaTeX -->
|
|
15
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css"
|
|
16
|
+
integrity="sha384-R4558gYOUz8mP9YWpZJjofhk+zx0AS11p36HnD2ZKj/6JR5z27gSSULCNHIRReVs" crossorigin="anonymous">
|
|
17
|
+
|
|
18
|
+
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
|
19
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js"
|
|
20
|
+
integrity="sha384-z1fJDqw8ZApjGO3/unPWUPsIymfsJmyrDVWC8Tv/a1HeOtGmkwNd/7xUS0Xcnvsx"
|
|
21
|
+
crossorigin="anonymous"></script>
|
|
22
|
+
|
|
23
|
+
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
|
24
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/contrib/auto-render.min.js"
|
|
25
|
+
integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
|
|
26
|
+
onload="renderMathInElement(document.body);"></script>
|
|
27
|
+
|
|
28
|
+
<link href="demo.css" rel="stylesheet">
|
|
5
29
|
</head>
|
|
6
30
|
<body>
|
|
7
31
|
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
<div
|
|
32
|
+
<div x-data="dev()">
|
|
33
|
+
<template x-for="(item, index) of output" :key="index">
|
|
34
|
+
<div class="katex-left" x-html="`\\[${item}\\]`"></div>
|
|
35
|
+
</template>
|
|
36
|
+
</div>
|
|
11
37
|
|
|
12
|
-
<
|
|
13
|
-
|
|
38
|
+
<script>
|
|
39
|
+
ex1()
|
|
14
40
|
|
|
15
|
-
|
|
16
|
-
|
|
41
|
+
function dev () {
|
|
42
|
+
let output = []
|
|
17
43
|
|
|
44
|
+
ex1()
|
|
45
|
+
// ex1()
|
|
46
|
+
// console.log(ex1())
|
|
47
|
+
output = [
|
|
48
|
+
'\\text{exercice 1}',
|
|
49
|
+
...ex1(),
|
|
50
|
+
'--------------',
|
|
51
|
+
'\\text{exercice 2}',
|
|
52
|
+
...ex2(),
|
|
53
|
+
'--------------',
|
|
54
|
+
'\\text{exercice 3}',
|
|
55
|
+
...ex3(),
|
|
56
|
+
'--------------',
|
|
57
|
+
'\\text{exercice 4}',
|
|
58
|
+
...ex4()]
|
|
59
|
+
|
|
60
|
+
// console.log(ex1())
|
|
61
|
+
return {
|
|
62
|
+
output
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function ex1 () {
|
|
67
|
+
// EXERCICE 1
|
|
68
|
+
let cart = [
|
|
69
|
+
'A',
|
|
70
|
+
'x^2-10x+y^2-8y+37=0',
|
|
71
|
+
'x^2-4x+y^2+6y+20=0',
|
|
72
|
+
'3x^2+3y^2+18y+3=0',
|
|
73
|
+
'4x^2-16x+8y^2-16y-10=0',
|
|
74
|
+
'B',
|
|
75
|
+
'x^2+10x+y^2-8y+32=0',
|
|
76
|
+
'5x^2+5y^2+80y+45=0',
|
|
77
|
+
'3x^2-9x+5y^2-10y+45=0',
|
|
78
|
+
'x^2-8x+y^2+4x+36=0'
|
|
79
|
+
], C, texData = []
|
|
80
|
+
|
|
81
|
+
for (let equ of cart) {
|
|
82
|
+
if (equ.length === 1) {
|
|
83
|
+
texData.push(`\\text{série ${equ}}`)
|
|
84
|
+
continue
|
|
85
|
+
}
|
|
86
|
+
C = new Pi.Geometry.Circle(equ)
|
|
87
|
+
if (C.exists) {
|
|
88
|
+
texData.push(equ + '\\implies ' + C.tex + '\\implies C' + C.center.tex + ',\\ r=' + C.radius.tex)
|
|
89
|
+
} else {
|
|
90
|
+
texData.push(equ + '\\implies' + '\\text{pas un cercle}')
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return texData
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function ex2 () {
|
|
98
|
+
let Center1 = new Pi.Geometry.Point(4, -2),
|
|
99
|
+
C1 = new Pi.Geometry.Circle(Center1, 10, true),
|
|
100
|
+
droites1 = [
|
|
101
|
+
'x+3y-8=0',
|
|
102
|
+
'x-6y+6=0',
|
|
103
|
+
'2x+y-1=0',
|
|
104
|
+
'3x-4y-36=0'
|
|
105
|
+
],
|
|
106
|
+
Center2 = new Pi.Geometry.Point(8, 6),
|
|
107
|
+
C2 = new Pi.Geometry.Circle(
|
|
108
|
+
Center2,
|
|
109
|
+
40,
|
|
110
|
+
true),
|
|
111
|
+
droites2 = [
|
|
112
|
+
'x-3y+30=0',
|
|
113
|
+
'4x+11y-22=0',
|
|
114
|
+
'3x-y+8=0',
|
|
115
|
+
'2x+y-32=0'
|
|
116
|
+
],
|
|
117
|
+
d, pr, out = []
|
|
118
|
+
|
|
119
|
+
out.push('\\text{série A}')
|
|
120
|
+
out.push('(\\Gamma_1):' + C1.tex)
|
|
121
|
+
for (let equ of droites1) {
|
|
122
|
+
d = new Pi.Geometry.Line(equ)
|
|
123
|
+
pr = C1.relativePosition(d)
|
|
124
|
+
|
|
125
|
+
if (pr === 0) {
|
|
126
|
+
out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C1.center).tex + '\\implies \\text{externe}\\ ')
|
|
127
|
+
} else if (pr === 1) {
|
|
128
|
+
out.push(d.tex.canonical + '\\implies \\text{tangent: }' + C1.lineIntersection(d)[0].tex)
|
|
129
|
+
} else {
|
|
130
|
+
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'))
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
out.push('\\text{série B}')
|
|
135
|
+
out.push('(\\Gamma_2):' + C2.tex)
|
|
136
|
+
for (let equ of droites2) {
|
|
137
|
+
d = new Pi.Geometry.Line(equ)
|
|
138
|
+
pr = C2.relativePosition(d)
|
|
139
|
+
if (pr === 0) {
|
|
140
|
+
out.push(d.tex.canonical + '\\implies \\delta = ' + d.distanceTo(C2.center).tex + '\\implies \\text{externe}')
|
|
141
|
+
} else if (pr === 1) {
|
|
142
|
+
out.push(d.tex.canonical + '\\implies \\text{tangent: }' + C2.lineIntersection(d)[0].tex)
|
|
143
|
+
} else {
|
|
144
|
+
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'))
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return out
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function ex3 () {
|
|
152
|
+
let C = new Pi.Geometry.Circle(
|
|
153
|
+
new Pi.Geometry.Point(-14, 18),
|
|
154
|
+
new Pi.Geometry.Point(-2, 14),
|
|
155
|
+
new Pi.Geometry.Point(-10, 22)
|
|
156
|
+
), T1 = new Pi.Geometry.Triangle(new Pi.Geometry.Point(-14, 18),
|
|
157
|
+
new Pi.Geometry.Point(-2, 14),
|
|
158
|
+
new Pi.Geometry.Point(-10, 22))
|
|
159
|
+
|
|
160
|
+
let E = new Pi.Geometry.Circle(
|
|
161
|
+
new Pi.Geometry.Point(4, 10),
|
|
162
|
+
new Pi.Geometry.Point(5, 5),
|
|
163
|
+
new Pi.Geometry.Point(9, 11)
|
|
164
|
+
), T2 = new Pi.Geometry.Triangle(
|
|
165
|
+
new Pi.Geometry.Point(4, 10),
|
|
166
|
+
new Pi.Geometry.Point(5, 5),
|
|
167
|
+
new Pi.Geometry.Point(9, 11)
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
return [
|
|
171
|
+
'\\text{2 milieux, 2 normales, 2 médiatrices, 2 intersection, 1 rayon, 1 équation}',
|
|
172
|
+
'\\text{série A}',
|
|
173
|
+
(new Pi.Geometry.Point().middleOf(T2.A, T2.B)).tex + '\\quad (m_{AB}):\\ ' + T2.remarquables.mediators.AB.tex.canonical,
|
|
174
|
+
(new Pi.Geometry.Point().middleOf(T2.A, T2.C)).tex + '\\quad (m_{AC}):\\ ' + T2.remarquables.mediators.AC.tex.canonical,
|
|
175
|
+
(new Pi.Geometry.Point().middleOf(T2.C, T2.B)).tex + '\\quad (m_{BC}):\\ ' + T2.remarquables.mediators.BC.tex.canonical,
|
|
176
|
+
E.tex,
|
|
177
|
+
'\\text{série B}',
|
|
178
|
+
(new Pi.Geometry.Point().middleOf(T1.A, T1.B)).tex + '\\quad (m_{AB}):\\ ' + T1.remarquables.mediators.AB.tex.canonical,
|
|
179
|
+
(new Pi.Geometry.Point().middleOf(T1.A, T1.C)).tex + '\\quad (m_{AC}):\\ ' + T1.remarquables.mediators.AC.tex.canonical,
|
|
180
|
+
(new Pi.Geometry.Point().middleOf(T1.C, T1.B)).tex + '\\quad (m_{BC}):\\ ' + T1.remarquables.mediators.BC.tex.canonical,
|
|
181
|
+
C.tex,
|
|
182
|
+
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function ex4 () {
|
|
187
|
+
// A
|
|
188
|
+
let A = new Pi.Geometry.Point(-6, -9),
|
|
189
|
+
C = new Pi.Geometry.Circle('(x+3)^2+(y+5)^2=25'),
|
|
190
|
+
Oy = C.cartesian.clone().replaceBy('x', new Pi.Polynom().zero()),
|
|
191
|
+
Ox = C.cartesian.clone().replaceBy('y', new Pi.Polynom().zero()),
|
|
192
|
+
t = new Pi.Geometry.Line(
|
|
193
|
+
A,
|
|
194
|
+
new Pi.Geometry.Vector(A, C.center),
|
|
195
|
+
Pi.Geometry.Line.PERPENDICULAR
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
Oy.solve()
|
|
199
|
+
Ox.solve()
|
|
200
|
+
|
|
201
|
+
// B
|
|
202
|
+
let A1 = new Pi.Geometry.Point(-4, -14),
|
|
203
|
+
C1 = new Pi.Geometry.Circle('(x-10)^2+(y+6)^2=100'),
|
|
204
|
+
Oy1 = C1.cartesian.clone().replaceBy('x', new Pi.Polynom().zero()),
|
|
205
|
+
Ox1 = C1.cartesian.clone().replaceBy('y', new Pi.Polynom().zero()),
|
|
206
|
+
t1 = new Pi.Geometry.Line(
|
|
207
|
+
A1,
|
|
208
|
+
new Pi.Geometry.Vector(A1, C1.center),
|
|
209
|
+
Pi.Geometry.Line.PERPENDICULAR
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
Oy1.solve()
|
|
213
|
+
Ox1.solve()
|
|
214
|
+
|
|
215
|
+
return [
|
|
216
|
+
'\\text{série A}',
|
|
217
|
+
'(Ox):\\ ' + Ox.solutions.map(y => `(${y.value};0)`),
|
|
218
|
+
'(Oy):\\ ' + Oy.solutions.map(x => `(0;${x.value})`),
|
|
219
|
+
'(t):\\ ' + t.tex.canonical,
|
|
220
|
+
'\\text{série B}',
|
|
221
|
+
'(Ox):\\ ' + Ox1.solutions.map(y => `(${y.value};0)`),
|
|
222
|
+
'(Oy):\\ ' + Oy1.solutions.map(x => `(0;${x.value})`),
|
|
223
|
+
'(t):\\ ' + t1.tex.canonical
|
|
224
|
+
]
|
|
225
|
+
}
|
|
18
226
|
|
|
19
|
-
<script>
|
|
20
227
|
|
|
21
|
-
let P = new Pi.Random.polynom({
|
|
22
|
-
degree: 4,
|
|
23
|
-
fraction: false
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
console.log(P.display)
|
|
27
|
-
|
|
28
|
-
// let C1 = new Pi.Geometry.Point(-5, 4),
|
|
29
|
-
// r1 = 36,
|
|
30
|
-
// C2 = new Pi.Geometry.Point(7, -2),
|
|
31
|
-
// T = new Pi.Geometry.Point(2, 3)
|
|
32
|
-
//
|
|
33
|
-
// let G1 = new Pi.Geometry.Circle(C1, r1, true),
|
|
34
|
-
// G2 = new Pi.Geometry.Circle(C2, T)
|
|
35
|
-
//
|
|
36
|
-
// console.log('G1', G1.tex)
|
|
37
|
-
// console.log('G2', G2.tex)
|
|
38
|
-
//
|
|
39
|
-
// let t = new Pi.Geometry.Line(
|
|
40
|
-
// new Pi.Geometry.Vector(C2, T),
|
|
41
|
-
// T
|
|
42
|
-
// )
|
|
43
|
-
//
|
|
44
|
-
// console.log(t.tex.canonical)
|
|
45
|
-
// console.log(G1.relativePosition(t))
|
|
46
|
-
//
|
|
47
|
-
// let d = new Pi.Geometry.Line(G1.center, G2.center)
|
|
48
|
-
// console.log(d.tex.canonical)
|
|
49
|
-
//
|
|
50
|
-
// let M = new Pi.Geometry.Point(
|
|
51
|
-
// G1.center.x.clone().add(G2.center.x).divide(2),
|
|
52
|
-
// G1.center.y.clone().add(G2.center.y).divide(2),
|
|
53
|
-
// )
|
|
54
|
-
//
|
|
55
|
-
// console.log(M.display)
|
|
56
|
-
//
|
|
57
|
-
// let k = new Pi.Geometry.Line().parseByPointAndLine(
|
|
58
|
-
// M, d,
|
|
59
|
-
// Pi.Geometry.Line.PERPENDICULAR
|
|
60
|
-
// )
|
|
61
|
-
//
|
|
62
|
-
// console.log(k.tex.canonical)
|
|
63
|
-
//
|
|
64
|
-
// console.log(G1.lineIntersection(d))
|
|
65
228
|
</script>
|
|
66
229
|
</body>
|
|
67
230
|
</html>
|