pimath 0.0.20 → 0.0.21
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/index.html +44 -37
- package/dev/pi.js +10 -3
- package/dev/pi.js.map +1 -1
- package/dist/pi.js +1 -1
- package/dist/pi.js.map +1 -1
- package/esm/maths/random/rndFraction.js +8 -2
- package/esm/maths/random/rndFraction.js.map +1 -1
- package/esm/maths/random/rndMonom.js +2 -1
- package/esm/maths/random/rndMonom.js.map +1 -1
- package/esm/maths/random/rndTypes.d.ts +1 -0
- package/package.json +1 -1
- package/src/maths/random/rndFraction.ts +7 -2
- package/src/maths/random/rndMonom.ts +2 -1
- package/src/maths/random/rndTypes.ts +2 -1
package/dev/index.html
CHANGED
|
@@ -18,43 +18,50 @@
|
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
T
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
console.log(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
console.log(
|
|
49
|
-
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
console.log(
|
|
56
|
-
|
|
57
|
-
|
|
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))
|
|
58
65
|
</script>
|
|
59
66
|
</body>
|
|
60
67
|
</html>
|
package/dev/pi.js
CHANGED
|
@@ -4107,7 +4107,8 @@ class rndFraction extends randomCore_1.randomCore {
|
|
|
4107
4107
|
this._defaultConfig = {
|
|
4108
4108
|
negative: true,
|
|
4109
4109
|
reduced: true,
|
|
4110
|
-
zero: true
|
|
4110
|
+
zero: true,
|
|
4111
|
+
natural: false
|
|
4111
4112
|
};
|
|
4112
4113
|
this._config = this.mergeConfig(userConfig, this._defaultConfig);
|
|
4113
4114
|
}
|
|
@@ -4119,7 +4120,12 @@ class rndFraction extends randomCore_1.randomCore {
|
|
|
4119
4120
|
else {
|
|
4120
4121
|
Q.numerator = index_1.Random.number(this._config.zero ? 0 : 1, 10);
|
|
4121
4122
|
}
|
|
4122
|
-
|
|
4123
|
+
if (this._config.natural) {
|
|
4124
|
+
Q.denominator = 1;
|
|
4125
|
+
}
|
|
4126
|
+
else {
|
|
4127
|
+
Q.denominator = index_1.Random.number(1, 10);
|
|
4128
|
+
}
|
|
4123
4129
|
return this._config.reduced ? Q.reduce() : Q;
|
|
4124
4130
|
};
|
|
4125
4131
|
}
|
|
@@ -4213,7 +4219,8 @@ class rndMonom extends randomCore_1.randomCore {
|
|
|
4213
4219
|
let M = new monom_1.Monom();
|
|
4214
4220
|
M.coefficient = index_1.Random.fraction({
|
|
4215
4221
|
zero: this._config.zero,
|
|
4216
|
-
reduced: true
|
|
4222
|
+
reduced: true,
|
|
4223
|
+
natural: !this._config.fraction
|
|
4217
4224
|
});
|
|
4218
4225
|
if (this._config.letters.length > 1) {
|
|
4219
4226
|
for (let L of this._config.letters.split('')) {
|