pimath 0.0.72 → 0.0.73
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/dist/pi.js +19 -2
- package/dist/pi.js.map +1 -1
- package/dist/pi.min.js +1 -1
- package/dist/pi.min.js.map +1 -1
- package/esm/maths/geometry/circle.js +19 -2
- package/esm/maths/geometry/circle.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/geometry/circle.ts +16 -3
- package/tests/geometry/circle.test.ts +15 -0
package/dist/pi.js
CHANGED
|
@@ -5199,9 +5199,26 @@ class Circle {
|
|
|
5199
5199
|
get developed() {
|
|
5200
5200
|
return this._cartesian.tex;
|
|
5201
5201
|
}
|
|
5202
|
-
// TODO: reformat code for better display.
|
|
5203
5202
|
get display() {
|
|
5204
|
-
|
|
5203
|
+
if (this._exists) {
|
|
5204
|
+
let cx, cy;
|
|
5205
|
+
if (this._center.x.isZero()) {
|
|
5206
|
+
cx = 'x^2';
|
|
5207
|
+
}
|
|
5208
|
+
else {
|
|
5209
|
+
cx = `(x${this._center.x.isNegative() ? '+' : '-'}${this._center.x.clone().abs().tex})^2`;
|
|
5210
|
+
}
|
|
5211
|
+
if (this._center.y.isZero()) {
|
|
5212
|
+
cy = 'y^2';
|
|
5213
|
+
}
|
|
5214
|
+
else {
|
|
5215
|
+
cy = `(y${this._center.y.isNegative() ? '+' : '-'}${this._center.y.clone().abs().tex})^2`;
|
|
5216
|
+
}
|
|
5217
|
+
return `${cx}+${cy}=${this._squareRadius.display}`;
|
|
5218
|
+
}
|
|
5219
|
+
else {
|
|
5220
|
+
return `\\text{le cercle n'existe pas.}`;
|
|
5221
|
+
}
|
|
5205
5222
|
}
|
|
5206
5223
|
clone() {
|
|
5207
5224
|
this._center = this._center.clone();
|