-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeatures.txt
587 lines (404 loc) · 8.02 KB
/
features.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# pg
Print content in white and get an input with a tag. The default tag is 'egg'.
```python
input_string = pg('Hello world!', "my-console-application")
print(input_string)
```
Input/Output:
```txt
Hello world!
$my-console-application> Hi
Hi
```
# get
Get an input, with a tag.
```python
input_string = get("my-console-application")
print(input_string)
```
Input/Output:
```txt
$my-console-application> Hi
Hi
```
# put
Print content in a certain eggdriver color. The default color is white. You can set the color to "" to reset the color.
You can also set an ending string using the `end` parameter.
```python
put("Hi", "", ";")
```
```txt
Hi;
```
# sleep
Wait a certain number of milliseconds.
```python
sleep(1000) ~ sleep for 1 second ~
```
# clearConsole
Clear the console.
```python
clearConsole() ~ clear the console ~
```
# display
Display a text in the console each certain number of milliseconds, while a condition is true.
The default condition is `true`.
```python
display("Hello world!", 1000, 1 > 0) ~ display the text "Hello world!" for 1 second ~
```
Each 1 second:
```txt
Hello world!
```
# sysCommand
Execute a python command. (Currently only for Windows).
```python
sysCommand("-m pip install --upgrade pip") ~ execute the command "py -m pip install --upgrade pip" ~
```
# ProgressBar
A progress bar pip-like for console implementations.
```python
bar = ProgressBar()
bar.iterate(printPercent = True)
```
Last iteration:
```txt
|████████████████████████████████| 100%
```
## ProgressBar.bar
Returns a ProgressBar as a text, with a certain length and percent of progress.
```python
p_bar = ProgressBar()
text = p_bar.bar(0.5, 16)
print(text)
```
```txt
|████████ | 50%
```
## ProgressBar.display
Display a progress bar in the console, with a certain length and percent of progress, waiting a certain number of milliseconds.
You can also set the `printPercent` parameter to `True` to print the percent of progress.
```python
p_bar = ProgressBar()
p_bar.display(0.75, 16, 1000, printPercent = False)
```
```txt
|████████████ |
```
## ProgressBar.iterate
For each percent of progress, display a progress bar in the console, with length 32 and a sleeping time of 24 milliseconds.
You can choose a function to execute at each iteration.
```python
p_bar = ProgressBar()
def my_function() {
print("Hello world!")
clearConsole()
}
p_bar.iterate(my_function, printPercent = True)
```
Iteration 25:
```txt
Hello world!
|████████ | 25%
```
Last iteration:
```txt
Hello world!
|████████████████████████████████| 100%
```
# inf
The computable infinity used for limits calculation.
inf = 10 ** 11
# series_inf
The computable infinity used for series calculation.
series_inf = 500
# R
The Reals numbers set.
R = [-inf, inf]
# e
The Euler number with 73 digits of precision.
e = 2.7182818284590452353602874713526624977572470936999595749669676277240766303
# pi
The number pi with 73 digits of precision.
pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062
# itself
The identity function.
```python
result = itself(10)
print(result)
```
```txt
10
```
# truncate
Truncate a number to a certain number of digits.
```python
result = truncate(pi, 5)
print(result)
```
```txt
3.14165
```
# floor
Return the floor function to a number.
```python
result = floor(pi)
print(result)
```
```txt
3
```
# ceil
Return the ceil function to a number.
```python
result = ceil(pi)
print(result)
```
```txt
4
```
# pow
Pow a number to a certain power.
```python
result = pow(2, 3)
print(result)
```
```txt
8
```
# log
Return the logarithm function of a number, with a certain base.
You can set an ansatz domain in order to improve the speed of the computation, using the `domain` parameter.
```python
result = log(e ** 2, e, domain = [1, 4])
print(result)
```
```txt
2
```
# ln
Return the natural logarithm function of a number.
```python
result = ln(1)
print(result)
```
```txt
0
```
# cos
Return the cosine function of a number.
```python
result = cos(pi/2)
print(result)
```
```txt
0
```
# sin
Return the sine function of a number.
```python
result = sin(pi/2)
print(result)
```
```txt
1
```
# tan
Return the tangent function of a number.
```python
result = tan(pi/4)
print(result)
```
```txt
1
```
# x
The x variable. Used for Polynomials and Series evaluation.
```python
result = x(2)
print(result)
```
```txt
2
```
# Polynomial
The Polynomials class. It allows to use Polynomials and Series.
You can create a Polynomial using the **vector syntax**:
```python
p = Polynomial([1, 2, 3])
```
or using the **literal syntax**:
```python
p = Polynomial("1 +2x +3x^2")
```
Using the literal syntax, **you can add literal polynomials in the initialisation**:
```python
p1 = Polynomial("1 +2x +3x^2" + "-4x")
p2 = Polynomial("1 +2x +3x^2 -4x")
p1.display()
p2.display()
```
```txt
1 -2x +3x^2
1 -2x +3x^2
```
Example of use:
```python
result = Polynomial("1 2x +x^2")
print(result)
result_list = list(result)
print(result_list)
```
```txt
1 2x +x^2
[1, 2, 1]
```
## Polynomial.degree
Return the degree of a Polynomial.
```python
poly = Polynomial("1 +3x^4 +x^3")
deg = poly.degree
print(deg)
```
```txt
4
```
## Polynomial.display
Display a Polynomial in the console.
```python
poly = Polynomial([1, 0, 3, 1])
poly.display()
```
```txt
1 +3x^2 +x^3
```
## Polynomial.eval
Return the evaluation of a Polynomial at a certain point.
```python
poly = Polynomial("1 -x^2")
result = poly.eval(7)
print(result)
```
```txt
-48
```
## Polynomial.power
Return the power of a Polynomial to a certain power.
```python
poly = Polynomial("1 +x")
result = poly.power(2)
result.display()
```
```txt
1 +2x +x^2
```
## Polynomial.plus
Return the sum of two Polynomials.
```python
poly1 = Polynomial("1 +3x^2 +x^3")
poly2 = Polynomial("4x +6x^3")
poly = poly1.plus(poly2)
poly.display()
```
```txt
1 +4x +3x^2 +7x^3
```
## Polynomial.times
Return the product of two Polynomials.
```python
poly1 = Polynomial("1 - 3x^2")
poly2 = Polynomial("5x^3")
poly = poly1.times(poly2)
poly.display()
```
```txt
5x^3 -15x^5
```
## Polynomial.var
The variable of a Polynomial.
```python
poly = Polynomial("1 - 3x^2")
v = poly.var
print(v)
```
```txt
x
```
## Polynomial.zeros
Return the zeros of a Polynomial.
```python
poly = Polynomial("1 - x^2")
z = poly.zeros
print(z)
```
```txt
[-1, 1]
```
# x_powered
Given the name of a variable, return the variable to the power of certain power.
```python
result = x_powered(2, "x")
print(result)
```
```txt
x^2
```
# plusPoly
Return the sum of two Polynomials.
```python
poly1 = Polynomial("1 +3x^2 +x^3")
poly2 = Polynomial("4x +6x^3")
poly = plusPoly(poly1, poly2)
poly.display()
```
```txt
1 +4x +3x^2 +7x^3
```
# scalePoly
Return the product of a Polynomial by a scalar.
```python
poly1 = Polynomial("1 +3x^2 +x^3")
poly = scalePoly(poly1, 5)
poly.display()
```
```txt
5 +15x^2 +5x^3
```
# times
Return the product of two Polynomials. Please prefer the [Polynomial.times](#Polynomial.times) instead.
```python
poly1 = Polynomial("1 - 3x^2")
poly2 = Polynomial("5x^3")
poly = times(poly1, poly2)
poly.display()
```
```txt
5x^3 -15x^5
```
# fromZeros
Given an iterable of numbers, return the Polynomial whose zeros are these numbers.
```python
poly = fromZeros([1, 7])
poly.display()
```
```txt
7 -8x +x^2
```
# solve
Return the solutions of a equation `function(x) == bias`, in a certain domain.
You can specify the degree of the function, the accurancy of the result, and if you want to see the alerts.
Specifying the degree allows to avoid unnecessary computations.
```python
def f {
return x**2 - 49
}
~ solve the equation f(x) == 0 ~
roots = solve(f, bias = 0, domain = R, accurancy = 16, degree = 2, alerts = false)
print(roots)
```
```txt
[-7, 7]
```
# root
Gives a root of the equation `function(x) == bias`, in a certain domain.
~ this will not be shown ~