pimath 0.0.127 → 0.0.128
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/.idea/jsLibraryMappings.xml +6 -0
- package/{public/index.html → dist/demo/exercises.html} +2 -2
- package/dist/demo/matrices.html +39 -0
- package/dist/demo/playground.html +20 -0
- package/dist/demo.css +3 -0
- package/dist/pimath.js +4239 -7819
- package/dist/pimath.umd.cjs +15 -0
- package/index.html +15 -0
- package/package.json +16 -8
- package/public/demo/exercises.html +283 -0
- package/public/demo/matrices.html +39 -0
- package/public/demo/playground.html +20 -0
- package/src/demo/exercises.ts +0 -0
- package/src/demo/matrices.ts +61 -0
- package/src/demo/playground.ts +153 -0
- package/src/{index.ts → main.ts} +1 -1
- package/src/maths/algebra/rational.ts +8 -4
- package/tsconfig.json +15 -4
- package/vite.config.js +23 -0
- package/webpack-production.config.js +22 -22
- package/webpack.config.js +22 -22
- package/dev/pimath.js +0 -7945
- package/dev/pimath.js.map +0 -1
- package/dist/pimath.js.map +0 -1
- package/dist/pimath.min.js +0 -2
- package/dist/pimath.min.js.map +0 -1
- package/esm/index.d.ts +0 -38
- package/esm/index.js +0 -44
- package/esm/index.js.map +0 -1
- package/esm/maths/algebra/equation.d.ts +0 -119
- package/esm/maths/algebra/equation.js +0 -797
- package/esm/maths/algebra/equation.js.map +0 -1
- package/esm/maths/algebra/linearSystem.d.ts +0 -39
- package/esm/maths/algebra/linearSystem.js +0 -279
- package/esm/maths/algebra/linearSystem.js.map +0 -1
- package/esm/maths/algebra/logicalset.d.ts +0 -28
- package/esm/maths/algebra/logicalset.js +0 -158
- package/esm/maths/algebra/logicalset.js.map +0 -1
- package/esm/maths/algebra/monom.d.ts +0 -206
- package/esm/maths/algebra/monom.js +0 -909
- package/esm/maths/algebra/monom.js.map +0 -1
- package/esm/maths/algebra/polynom.d.ts +0 -157
- package/esm/maths/algebra/polynom.js +0 -1305
- package/esm/maths/algebra/polynom.js.map +0 -1
- package/esm/maths/algebra/rational.d.ts +0 -46
- package/esm/maths/algebra/rational.js +0 -195
- package/esm/maths/algebra/rational.js.map +0 -1
- package/esm/maths/algebra/study/rationalStudy.d.ts +0 -28
- package/esm/maths/algebra/study/rationalStudy.js +0 -244
- package/esm/maths/algebra/study/rationalStudy.js.map +0 -1
- package/esm/maths/algebra/study.d.ts +0 -143
- package/esm/maths/algebra/study.js +0 -380
- package/esm/maths/algebra/study.js.map +0 -1
- package/esm/maths/coefficients/fraction.d.ts +0 -90
- package/esm/maths/coefficients/fraction.js +0 -517
- package/esm/maths/coefficients/fraction.js.map +0 -1
- package/esm/maths/coefficients/nthRoot.d.ts +0 -23
- package/esm/maths/coefficients/nthRoot.js +0 -137
- package/esm/maths/coefficients/nthRoot.js.map +0 -1
- package/esm/maths/geometry/circle.d.ts +0 -45
- package/esm/maths/geometry/circle.js +0 -324
- package/esm/maths/geometry/circle.js.map +0 -1
- package/esm/maths/geometry/line.d.ts +0 -99
- package/esm/maths/geometry/line.js +0 -485
- package/esm/maths/geometry/line.js.map +0 -1
- package/esm/maths/geometry/point.d.ts +0 -34
- package/esm/maths/geometry/point.js +0 -167
- package/esm/maths/geometry/point.js.map +0 -1
- package/esm/maths/geometry/triangle.d.ts +0 -91
- package/esm/maths/geometry/triangle.js +0 -276
- package/esm/maths/geometry/triangle.js.map +0 -1
- package/esm/maths/geometry/vector.d.ts +0 -41
- package/esm/maths/geometry/vector.js +0 -198
- package/esm/maths/geometry/vector.js.map +0 -1
- package/esm/maths/numeric.d.ts +0 -28
- package/esm/maths/numeric.js +0 -136
- package/esm/maths/numeric.js.map +0 -1
- package/esm/maths/numexp.d.ts +0 -19
- package/esm/maths/numexp.js +0 -186
- package/esm/maths/numexp.js.map +0 -1
- package/esm/maths/randomization/random.d.ts +0 -23
- package/esm/maths/randomization/random.js +0 -79
- package/esm/maths/randomization/random.js.map +0 -1
- package/esm/maths/randomization/randomCore.d.ts +0 -7
- package/esm/maths/randomization/randomCore.js +0 -22
- package/esm/maths/randomization/randomCore.js.map +0 -1
- package/esm/maths/randomization/rndFraction.d.ts +0 -12
- package/esm/maths/randomization/rndFraction.js +0 -44
- package/esm/maths/randomization/rndFraction.js.map +0 -1
- package/esm/maths/randomization/rndGeometryLine.d.ts +0 -12
- package/esm/maths/randomization/rndGeometryLine.js +0 -46
- package/esm/maths/randomization/rndGeometryLine.js.map +0 -1
- package/esm/maths/randomization/rndGeometryPoint.d.ts +0 -12
- package/esm/maths/randomization/rndGeometryPoint.js +0 -61
- package/esm/maths/randomization/rndGeometryPoint.js.map +0 -1
- package/esm/maths/randomization/rndHelpers.d.ts +0 -23
- package/esm/maths/randomization/rndHelpers.js +0 -98
- package/esm/maths/randomization/rndHelpers.js.map +0 -1
- package/esm/maths/randomization/rndMonom.d.ts +0 -12
- package/esm/maths/randomization/rndMonom.js +0 -53
- package/esm/maths/randomization/rndMonom.js.map +0 -1
- package/esm/maths/randomization/rndPolynom.d.ts +0 -13
- package/esm/maths/randomization/rndPolynom.js +0 -75
- package/esm/maths/randomization/rndPolynom.js.map +0 -1
- package/esm/maths/randomization/rndTypes.d.ts +0 -34
- package/esm/maths/randomization/rndTypes.js +0 -3
- package/esm/maths/randomization/rndTypes.js.map +0 -1
- package/esm/maths/shutingyard.d.ts +0 -59
- package/esm/maths/shutingyard.js +0 -443
- package/esm/maths/shutingyard.js.map +0 -1
- package/public/matrices.html +0 -100
- package/public/playground.html +0 -168
package/public/playground.html
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Getting Started</title>
|
|
5
|
-
<script src="../dev/pimath.js"></script>
|
|
6
|
-
|
|
7
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
|
|
8
|
-
|
|
9
|
-
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
|
10
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
|
|
11
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"></script>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
|
|
15
|
-
<div id="output"></div>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
let A = new PiMath.Geometry.Point(0,2),
|
|
19
|
-
B = new PiMath.Geometry.Point(2,3),
|
|
20
|
-
C = new PiMath.Geometry.Point(1/2, 4),
|
|
21
|
-
D = new PiMath.Geometry.Point(2, -1/2);
|
|
22
|
-
|
|
23
|
-
let L1 = new PiMath.Geometry.Line(A, B).simplifyDirection(),
|
|
24
|
-
L2 = new PiMath.Geometry.Line(C, D).simplifyDirection();
|
|
25
|
-
|
|
26
|
-
document.getElementById('output').innerHTML = `<p>\\( ${L1.tex.parametric} \\)</p>`;
|
|
27
|
-
document.getElementById('output').innerHTML += `<p>\\( ${L2.tex.parametric} \\)</p>`;
|
|
28
|
-
|
|
29
|
-
let I = L1.intersection(L2);
|
|
30
|
-
if(I.hasIntersection) {
|
|
31
|
-
document.getElementById('output').innerHTML += `<p>\\[ ${L1.intersection(L2).point.tex} \\]</p>`
|
|
32
|
-
}else if(I.isParallel){
|
|
33
|
-
document.getElementById('output').innerHTML += `<p>Elles sont parallèles</p>`
|
|
34
|
-
}else if(I.isSame){
|
|
35
|
-
document.getElementById('output').innerHTML += `<p>Elles sont confondues</p>`
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
renderMathInElement(document.getElementById('output'), {fleqn: true});
|
|
39
|
-
/*let p;
|
|
40
|
-
p = new Pi.Polynom('3x(6x+9)+6(6x+9)');
|
|
41
|
-
document.getElementById('output').innerHTML = `<p>${p.raw}</p>`;
|
|
42
|
-
document.getElementById('output').innerHTML += `<p>${p.display}</p>`;
|
|
43
|
-
|
|
44
|
-
let v1 = new Pi.Vector('3 4'),
|
|
45
|
-
v2 = new Pi.Vector('-2 5');
|
|
46
|
-
|
|
47
|
-
console.log(v1);
|
|
48
|
-
console.log(v2);
|
|
49
|
-
console.log(Pi.Vector.scalarProduct(v1, v2));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let P = new Pi.Polynom('(x+5)(x-17)(37x+35)');
|
|
53
|
-
let Q = new Pi.Polynom('1');
|
|
54
|
-
P.factorize(100)
|
|
55
|
-
|
|
56
|
-
P.factors.forEach(n=> {
|
|
57
|
-
console.log(n.tex)
|
|
58
|
-
Q.multiply(n);
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
// Check that we have the same polynom.
|
|
62
|
-
console.log(P.tex);
|
|
63
|
-
console.log(Q.tex);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/*let n = new Pi.Polynom(),
|
|
70
|
-
d = new Pi.Polynom();
|
|
71
|
-
n.parse('(x+3)(x+4)');
|
|
72
|
-
d.parse('(x+3)(x-2)')
|
|
73
|
-
|
|
74
|
-
let r = new Pi.Rational(n, d);
|
|
75
|
-
document.getElementById('output').innerHTML = `<p>${r.tex}</p>`*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/*
|
|
79
|
-
let M = new Pi.Monom().random('x', 2, false, false);
|
|
80
|
-
console.log(M.displayWithSign);
|
|
81
|
-
|
|
82
|
-
let S = new Pi.LinearSystem().parse(
|
|
83
|
-
'x-3y=-2',
|
|
84
|
-
'4x+7x=1'
|
|
85
|
-
);
|
|
86
|
-
S.solve();
|
|
87
|
-
document.getElementById('output').innerHTML = `<p>${S.tex}</p>`;
|
|
88
|
-
document.getElementById('output').innerHTML += `<p>${S.texSolution}</p>`;
|
|
89
|
-
let S = new Pi.LinearSystem().generate(3,-5,2);
|
|
90
|
-
document.getElementById('output').innerHTML = `<p>${S.tex}</p>`;
|
|
91
|
-
S.solve();
|
|
92
|
-
S.log;
|
|
93
|
-
S.tex;
|
|
94
|
-
|
|
95
|
-
S = new Pi.LinearSystem().generate(-1,8,-2);
|
|
96
|
-
document.getElementById('output').innerHTML += `<p>${S.tex}</p>`;
|
|
97
|
-
S.solve();
|
|
98
|
-
S.log;
|
|
99
|
-
|
|
100
|
-
let P = new Pi.Polynom('3x^2+5yx-2');
|
|
101
|
-
console.log(P.tex);
|
|
102
|
-
console.log(P.numberOfVars);
|
|
103
|
-
P.replaceBy('y', new Pi.Polynom('2x+1'));
|
|
104
|
-
console.log(P.tex);
|
|
105
|
-
|
|
106
|
-
let A = new Pi.Equation('2x+3y=5');
|
|
107
|
-
console.log(A.tex);
|
|
108
|
-
|
|
109
|
-
A.isolate('x');
|
|
110
|
-
console.log(A.tex);
|
|
111
|
-
|
|
112
|
-
A.isolate('y');
|
|
113
|
-
console.log(A.tex);
|
|
114
|
-
|
|
115
|
-
let P = new Pi.Polynom().rndSimple(2).makeItComplicate();
|
|
116
|
-
console.log(P.tex);
|
|
117
|
-
console.log(P.texString);
|
|
118
|
-
|
|
119
|
-
let A = new Pi.Fraction().parse('2/5');
|
|
120
|
-
console.log(A.frac);
|
|
121
|
-
|
|
122
|
-
let F = new Pi.Fraction().parse('18/5');
|
|
123
|
-
let N = new Pi.Root().parse(F).reduce();
|
|
124
|
-
console.log(N.tex);
|
|
125
|
-
|
|
126
|
-
let E = new Pi.Equation().create(new Pi.Polynom().parse('x^2+6x-8'), new Pi.Polynom().zero());
|
|
127
|
-
E.solve();
|
|
128
|
-
console.log(E.solutions);
|
|
129
|
-
|
|
130
|
-
let D = 42;
|
|
131
|
-
console.log(Pi.Numeric.dividers(D));
|
|
132
|
-
|
|
133
|
-
let X = new Pi.Polynom().rndFactorable(2, false);
|
|
134
|
-
console.log(X.tex);
|
|
135
|
-
X.factors.forEach(function(P, i){
|
|
136
|
-
console.log(P.tex);
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
let EQ = new Pi.Equation('2x+3>=5x-2');
|
|
140
|
-
EQ.solve();
|
|
141
|
-
console.log(EQ.solution);
|
|
142
|
-
|
|
143
|
-
EQ.parseString('2x+3<5x-2');
|
|
144
|
-
EQ.solve();
|
|
145
|
-
console.log(EQ.solution);
|
|
146
|
-
|
|
147
|
-
EQ.parseString('7x+3>5x-2');
|
|
148
|
-
EQ.solve();
|
|
149
|
-
console.log(EQ.solution);
|
|
150
|
-
|
|
151
|
-
EQ.parseString('7x+3=<5x-2');
|
|
152
|
-
EQ.solve();
|
|
153
|
-
console.log(EQ.solution);
|
|
154
|
-
|
|
155
|
-
EQ.parseString('7x+3=<7x-2');
|
|
156
|
-
EQ.solve();
|
|
157
|
-
console.log(EQ.solution);
|
|
158
|
-
|
|
159
|
-
EQ.parseString('7x+3>7x-2');
|
|
160
|
-
EQ.solve();
|
|
161
|
-
console.log(EQ.solution);
|
|
162
|
-
|
|
163
|
-
EQ.parseString('x^2+6x+9>=0');
|
|
164
|
-
EQ.solve();
|
|
165
|
-
console.log(EQ.solution);*/
|
|
166
|
-
</script>
|
|
167
|
-
</body>
|
|
168
|
-
</html>
|