@@ -22,11 +22,10 @@ import p5 from '../core/main';
22
22
*
23
23
* print(x); // -3
24
24
* print(y); // 3
25
+ *
26
+ * describe(`no image displayed`);
25
27
* }
26
28
* </code></div>
27
- *
28
- * @alt
29
- * no image displayed
30
29
*/
31
30
p5 . prototype . abs = Math . abs ;
32
31
@@ -61,11 +60,11 @@ p5.prototype.abs = Math.abs;
61
60
* noStroke();
62
61
* text(nfc(ax, 2), ax, ay - 5);
63
62
* text(nfc(bx, 1), bx, by - 5);
63
+ *
64
+ * describe(`2 horizontal lines & number sets. increase with
65
+ * mouse x. bottom to 2 decimals`);
64
66
* }
65
67
* </code></div>
66
- *
67
- * @alt
68
- * 2 horizontal lines & number sets. increase with mouse x. bottom to 2 decimals
69
68
*/
70
69
p5 . prototype . ceil = Math . ceil ;
71
70
@@ -102,11 +101,11 @@ p5.prototype.ceil = Math.ceil;
102
101
* ellipse(xm, 33, 9, 9); // Not Constrained
103
102
* fill(0);
104
103
* ellipse(xc, 66, 9, 9); // Constrained
104
+ *
105
+ * describe(`2 vertical lines. 2 ellipses move with mouse X,
106
+ * 1 does not move past lines`);
105
107
* }
106
108
* </code></div>
107
- *
108
- * @alt
109
- * 2 vertical lines. 2 ellipses move with mouse X 1 does not move passed lines
110
109
*/
111
110
p5 . prototype . constrain = function ( n , low , high ) {
112
111
p5 . _validateParameters ( 'constrain' , arguments ) ;
@@ -152,11 +151,11 @@ p5.prototype.constrain = function(n, low, high) {
152
151
* text(nfc(d, 1), 0, -5);
153
152
* pop();
154
153
* // Fancy!
154
+ *
155
+ * describe(`2 ellipses joined by line. 1 ellipse moves with
156
+ * mouse X&Y. Distance displayed.`);
155
157
* }
156
158
* </code></div>
157
- *
158
- * @alt
159
- * 2 ellipses joined by line. 1 ellipse moves with mouse X&Y. Distance displayed.
160
159
*/
161
160
/**
162
161
* @method dist
@@ -220,11 +219,10 @@ p5.prototype.dist = function(...args) {
220
219
* endShape();
221
220
* line(0, 0, 0, height);
222
221
* line(0, height - 1, width, height - 1);
222
+ *
223
+ * describe(`ellipse moves along a curve with mouse x. e^n displayed.`);
223
224
* }
224
225
* </code></div>
225
- *
226
- * @alt
227
- * ellipse moves along a curve with mouse x. e^n displayed.
228
226
*/
229
227
p5 . prototype . exp = Math . exp ;
230
228
@@ -258,11 +256,11 @@ p5.prototype.exp = Math.exp;
258
256
* noStroke();
259
257
* text(nfc(ax, 2), ax, ay - 5);
260
258
* text(nfc(bx, 1), bx, by - 5);
259
+ *
260
+ * describe(`2 horizontal lines & number sets.
261
+ * increase with mouse x. bottom to 2 decimals`);
261
262
* }
262
263
* </code></div>
263
- *
264
- * @alt
265
- * 2 horizontal lines & number sets. increase with mouse x. bottom to 2 decimals
266
264
*/
267
265
p5 . prototype . floor = Math . floor ;
268
266
@@ -302,11 +300,11 @@ p5.prototype.floor = Math.floor;
302
300
* point(c, y);
303
301
* point(d, y);
304
302
* point(e, y);
303
+ *
304
+ * describe(`5 points horizontally staggered mid-canvas.
305
+ * mid 3 are grey, outer black`);
305
306
* }
306
307
* </code></div>
307
- *
308
- * @alt
309
- * 5 points horizontally staggered mid-canvas. mid 3 are grey, outer black
310
308
*/
311
309
p5 . prototype . lerp = function ( start , stop , amt ) {
312
310
p5 . _validateParameters ( 'lerp' , arguments ) ;
@@ -360,11 +358,11 @@ p5.prototype.lerp = function(start, stop, amt) {
360
358
* endShape();
361
359
* line(0, 0, 0, height);
362
360
* line(0, height / 2, width, height / 2);
361
+ *
362
+ * describe(`ellipse moves along a curve with mouse x.
363
+ * natural logarithm of n displayed.`);
363
364
* }
364
365
* </code></div>
365
- *
366
- * @alt
367
- * ellipse moves along a curve with mouse x. natural logarithm of n displayed.
368
366
*/
369
367
p5 . prototype . log = Math . log ;
370
368
@@ -395,11 +393,10 @@ p5.prototype.log = Math.log;
395
393
* print(mag(x1, y2)); // Prints "72.80109889280519"
396
394
* line(0, 0, x2, y2);
397
395
* print(mag(x2, y2)); // Prints "106.3014581273465"
396
+ *
397
+ * describe(`4 lines of different length radiate from top left of canvas.`);
398
398
* }
399
399
* </code></div>
400
- *
401
- * @alt
402
- * 4 lines of different length radiate from top left of canvas.
403
400
*/
404
401
p5 . prototype . mag = function ( x , y ) {
405
402
p5 . _validateParameters ( 'mag' , arguments ) ;
@@ -426,6 +423,7 @@ p5.prototype.mag = function(x, y) {
426
423
* let value = 25;
427
424
* let m = map(value, 0, 100, 0, width);
428
425
* ellipse(m, 50, 10, 10);
426
+ * describe(`10×10 white ellipse with in mid left canvas`);
429
427
</code></div>
430
428
*
431
429
* <div><code>
@@ -441,12 +439,11 @@ p5.prototype.mag = function(x, y) {
441
439
* //after setting withinBounds to true
442
440
* let x2 = map(mouseX, 0, width, 0, 100, true);
443
441
* ellipse(x2, 75, 25, 25);
442
+ *
443
+ * describe(`Two 25×25 white ellipses move with mouse x.
444
+ * Bottom has more range from X`);
444
445
* }
445
446
</code></div>
446
- *
447
- * @alt
448
- * 10 by 10 white ellipse with in mid left canvas
449
- * 2 25 by 25 white ellipses move with mouse x. Bottom has more range from X
450
447
*/
451
448
p5 . prototype . map = function ( n , start1 , stop1 , start2 , stop2 , withinBounds ) {
452
449
p5 . _validateParameters ( 'map' , arguments ) ;
@@ -490,11 +487,11 @@ p5.prototype.map = function(n, start1, stop1, start2, stop2, withinBounds) {
490
487
* // Draw the Maximum value in the array.
491
488
* textSize(32);
492
489
* text(max(numArray), maxX, maxY);
490
+ *
491
+ * describe(`Small text at top reads: Array Elements 2 1 5 4 8 9.
492
+ * Large text at center: 9`);
493
493
* }
494
494
* </code></div>
495
- *
496
- * @alt
497
- * Small text at top reads: Array Elements 2 1 5 4 8 9. Large text at center: 9
498
495
*/
499
496
/**
500
497
* @method max
@@ -538,11 +535,11 @@ p5.prototype.max = function(...args) {
538
535
* // Draw the Minimum value in the array.
539
536
* textSize(32);
540
537
* text(min(numArray), maxX, maxY);
538
+ *
539
+ * describe(`Small text at top reads: Array Elements 2 1 5 4 8 9.
540
+ * Large text at center: 1`);
541
541
* }
542
542
* </code></div>
543
- *
544
- * @alt
545
- * Small text at top reads: Array Elements 2 1 5 4 8 9. Large text at center: 1
546
543
*/
547
544
/**
548
545
* @method min
@@ -598,11 +595,11 @@ p5.prototype.min = function(...args) {
598
595
* let normalY = 40;
599
596
* let normalX = 20;
600
597
* text(normalized, normalX, normalY);
598
+ *
599
+ * describe(`ellipse moves with mouse. 0 shown left, 100 right,
600
+ * and updating values center`);
601
601
* }
602
602
* </code></div>
603
- *
604
- * @alt
605
- * ellipse moves with mouse. 0 shown left & 100 right and updating values center
606
603
*/
607
604
p5 . prototype . norm = function ( n , start , stop ) {
608
605
p5 . _validateParameters ( 'norm' , arguments ) ;
@@ -635,11 +632,10 @@ p5.prototype.norm = function(n, start, stop) {
635
632
* ellipse(eLoc * 4, eLoc * 4, pow(eSize, 3), pow(eSize, 3));
636
633
*
637
634
* ellipse(eLoc * 8, eLoc * 8, pow(eSize, 4), pow(eSize, 4));
635
+ *
636
+ * describe(`small to large ellipses radiating from top left of canvas`);
638
637
* }
639
638
* </code></div>
640
- *
641
- * @alt
642
- * small to large ellipses radiating from top left of canvas
643
639
*/
644
640
p5 . prototype . pow = Math . pow ;
645
641
@@ -655,10 +651,12 @@ p5.prototype.pow = Math.pow;
655
651
* <div><code>
656
652
* let x = round(3.7);
657
653
* text(x, width / 2, height / 2);
654
+ * describe(`"4" written in middle of canvas`);
658
655
* </code></div>
659
656
* <div><code>
660
657
* let x = round(12.782383, 2);
661
658
* text(x, width / 2, height / 2);
659
+ * describe(`"12.78" written in middle of canvas`);
662
660
* </code></div>
663
661
* <div><code>
664
662
* function draw() {
@@ -682,13 +680,10 @@ p5.prototype.pow = Math.pow;
682
680
* noStroke();
683
681
* text(nfc(ax, 2), ax, ay - 5);
684
682
* text(nfc(bx, 1), bx, by - 5);
683
+ *
684
+ * describe(`two horizontal lines rounded values displayed on top.`);
685
685
* }
686
686
* </code></div>
687
- *
688
- * @alt
689
- * "4" written in middle of canvas
690
- * "12.78" written in middle of canvas
691
- * two horizontal lines rounded values displayed on top.
692
687
*/
693
688
p5 . prototype . round = function ( n , decimals ) {
694
689
if ( ! decimals ) {
@@ -734,11 +729,11 @@ p5.prototype.round = function(n, decimals) {
734
729
* fill(0);
735
730
* text('x = ' + x1, 0, y1 + spacing);
736
731
* text('sq(x) = ' + x2, 0, y2 + spacing);
732
+ *
733
+ * describe(`horizontal center line squared values displayed on
734
+ * top and regular on bottom.`);
737
735
* }
738
736
* </code></div>
739
- *
740
- * @alt
741
- * horizontal center line squared values displayed on top and regular on bottom.
742
737
*/
743
738
p5 . prototype . sq = n => n * n ;
744
739
@@ -779,11 +774,11 @@ p5.prototype.sq = n => n * n;
779
774
* let spacing = 15;
780
775
* text('x = ' + x1, 0, y1 + spacing);
781
776
* text('sqrt(x) = ' + x2, 0, y2 + spacing);
777
+ *
778
+ * describe(`horizontal center line squareroot values displayed on
779
+ * top and regular on bottom.`);
782
780
* }
783
781
* </code></div>
784
- *
785
- * @alt
786
- * horizontal center line squareroot values displayed on top and regular on bottom.
787
782
*/
788
783
p5 . prototype . sqrt = Math . sqrt ;
789
784
@@ -839,16 +834,16 @@ function hypot(x, y, z) {
839
834
* <div><code>
840
835
* text(7345.73472742, 10, 25);
841
836
* text(fract(7345.73472742), 10, 75);
837
+ * describe(`first row having a number and the second having
838
+ * the fractional part of the number`);
842
839
* </code></div>
843
840
*
844
841
* <div><code>
845
842
* text(1.4215e-15, 10, 25);
846
843
* text(fract(1.4215e-15), 10, 75);
844
+ * describe(`first row having a number expressed in scientific
845
+ * notation and the second having the fractional part of the number`);
847
846
* </code></div>
848
- *
849
- * @alt
850
- * first row having a number and the second having the fractional part of the number
851
- * first row having a number expressed in scientific notation and the second having the fractional part of the number
852
847
*/
853
848
p5 . prototype . fract = function ( toConvert ) {
854
849
p5 . _validateParameters ( 'fract' , arguments ) ;
0 commit comments