p5 2.2.1-rc.0 → 2.2.1

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.
Files changed (117) hide show
  1. package/dist/accessibility/color_namer.js +5 -6
  2. package/dist/accessibility/describe.js +4 -26
  3. package/dist/accessibility/index.js +5 -6
  4. package/dist/accessibility/outputs.js +6 -38
  5. package/dist/app.js +5 -6
  6. package/dist/color/color_conversion.js +5 -6
  7. package/dist/color/creating_reading.js +1 -1
  8. package/dist/color/index.js +2 -2
  9. package/dist/color/p5.Color.js +1 -1
  10. package/dist/color/setting.js +59 -357
  11. package/dist/{constants-DEJVKr9Z.js → constants-DQyACdzq.js} +11 -61
  12. package/dist/core/constants.js +1 -1
  13. package/dist/core/environment.js +26 -158
  14. package/dist/core/filterShaders.js +1 -1
  15. package/dist/core/friendly_errors/fes_core.js +1 -1
  16. package/dist/core/friendly_errors/file_errors.js +1 -1
  17. package/dist/core/friendly_errors/index.js +1 -1
  18. package/dist/core/friendly_errors/param_validator.js +1 -1
  19. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  20. package/dist/core/helpers.js +1 -1
  21. package/dist/core/init.js +5 -6
  22. package/dist/core/internationalization.js +1 -1
  23. package/dist/core/legacy.js +5 -6
  24. package/dist/core/main.js +5 -6
  25. package/dist/core/p5.Graphics.js +4 -5
  26. package/dist/core/p5.Renderer.js +3 -4
  27. package/dist/core/p5.Renderer2D.js +5 -6
  28. package/dist/core/p5.Renderer3D.js +4 -5
  29. package/dist/core/rendering.js +4 -5
  30. package/dist/core/structure.js +13 -52
  31. package/dist/core/transform.js +32 -176
  32. package/dist/{creating_reading-CgHCHxqN.js → creating_reading-ZXzcZEsb.js} +3 -196
  33. package/dist/data/local_storage.js +4 -30
  34. package/dist/dom/dom.js +24 -159
  35. package/dist/dom/index.js +2 -2
  36. package/dist/dom/p5.Element.js +31 -208
  37. package/dist/dom/p5.File.js +1 -32
  38. package/dist/dom/p5.MediaElement.js +10 -113
  39. package/dist/events/acceleration.js +11 -64
  40. package/dist/events/keyboard.js +13 -81
  41. package/dist/events/pointer.js +18 -160
  42. package/dist/image/const.js +1 -1
  43. package/dist/image/filterRenderer2D.js +4 -5
  44. package/dist/image/image.js +4 -5
  45. package/dist/image/index.js +4 -5
  46. package/dist/image/loading_displaying.js +4 -5
  47. package/dist/image/p5.Image.js +3 -4
  48. package/dist/image/pixels.js +17 -100
  49. package/dist/io/files.js +4 -5
  50. package/dist/io/index.js +4 -5
  51. package/dist/io/p5.Table.js +66 -158
  52. package/dist/io/p5.TableRow.js +48 -71
  53. package/dist/io/p5.XML.js +6 -99
  54. package/dist/io/utilities.js +8 -3
  55. package/dist/{main-_RXV5Lx8.js → main-DvN69W3f.js} +13 -42
  56. package/dist/math/Matrices/Matrix.js +87 -126
  57. package/dist/math/Matrices/MatrixNumjs.js +1 -5
  58. package/dist/math/calculation.js +10 -112
  59. package/dist/math/index.js +1 -1
  60. package/dist/math/math.js +2 -12
  61. package/dist/math/noise.js +5 -32
  62. package/dist/math/p5.Matrix.js +3 -3
  63. package/dist/math/p5.Vector.js +104 -345
  64. package/dist/math/random.js +5 -32
  65. package/dist/math/trigonometry.js +15 -105
  66. package/dist/{p5.Renderer-QoFcvj3f.js → p5.Renderer-D-5LdCRz.js} +25 -178
  67. package/dist/{rendering-CsICjEXA.js → rendering-h9unX5K0.js} +254 -1156
  68. package/dist/shape/2d_primitives.js +33 -194
  69. package/dist/shape/attributes.js +12 -73
  70. package/dist/shape/curves.js +30 -95
  71. package/dist/shape/custom_shapes.js +63 -144
  72. package/dist/shape/index.js +2 -2
  73. package/dist/shape/vertex.js +21 -106
  74. package/dist/strands/p5.strands.js +248 -46
  75. package/dist/type/index.js +3 -4
  76. package/dist/type/p5.Font.js +4 -49
  77. package/dist/type/textCore.js +5 -158
  78. package/dist/utilities/conversion.js +17 -104
  79. package/dist/utilities/time_date.js +3 -40
  80. package/dist/utilities/utility_functions.js +6 -48
  81. package/dist/webgl/3d_primitives.js +4 -5
  82. package/dist/webgl/GeometryBuilder.js +1 -2
  83. package/dist/webgl/ShapeBuilder.js +22 -2
  84. package/dist/webgl/enums.js +1 -1
  85. package/dist/webgl/index.js +4 -5
  86. package/dist/webgl/interaction.js +6 -33
  87. package/dist/webgl/light.js +4 -5
  88. package/dist/webgl/loading.js +12 -46
  89. package/dist/webgl/material.js +4 -5
  90. package/dist/webgl/p5.Camera.js +4 -5
  91. package/dist/webgl/p5.DataArray.js +0 -4
  92. package/dist/webgl/p5.Framebuffer.js +4 -5
  93. package/dist/webgl/p5.Geometry.js +12 -106
  94. package/dist/webgl/p5.Quat.js +1 -1
  95. package/dist/webgl/p5.RendererGL.js +7 -18
  96. package/dist/webgl/p5.Shader.js +12 -36
  97. package/dist/webgl/p5.Texture.js +4 -5
  98. package/dist/webgl/text.js +4 -5
  99. package/dist/webgl/utils.js +4 -5
  100. package/dist/webgpu/index.js +1 -1
  101. package/dist/webgpu/p5.RendererWebGPU.js +529 -208
  102. package/dist/webgpu/shaders/color.js +32 -17
  103. package/dist/webgpu/shaders/filters/base.js +18 -7
  104. package/dist/webgpu/shaders/font.js +52 -40
  105. package/dist/webgpu/shaders/line.js +50 -36
  106. package/dist/webgpu/shaders/material.js +90 -83
  107. package/dist/webgpu/strands_wgslBackend.js +5 -2
  108. package/lib/p5.esm.js +5576 -7811
  109. package/lib/p5.esm.min.js +1 -1
  110. package/lib/p5.js +5576 -7811
  111. package/lib/p5.min.js +1 -1
  112. package/lib/p5.webgpu.esm.js +786 -453
  113. package/lib/p5.webgpu.js +786 -453
  114. package/lib/p5.webgpu.min.js +1 -1
  115. package/package.json +13 -13
  116. package/types/global.d.ts +16905 -16783
  117. package/types/p5.d.ts +11142 -11081
@@ -1,4 +1,4 @@
1
- import { q as TWO_PI } from '../constants-DEJVKr9Z.js';
1
+ import { q as TWO_PI } from '../constants-DQyACdzq.js';
2
2
 
3
3
  /**
4
4
  * @module Math
@@ -261,16 +261,13 @@ class Vector {
261
261
  * @return {String} string representation of the vector.
262
262
  *
263
263
  * @example
264
- * <div class = "norender">
265
- * <code>
264
+ * // META:norender
266
265
  * function setup() {
267
266
  * let v = createVector(20, 30);
268
267
  *
269
268
  * // Prints 'vector[20, 30, 0]'.
270
269
  * print(v.toString());
271
270
  * }
272
- * </code>
273
- * </div>
274
271
  */
275
272
  toString() {
276
273
  return `vector[${this._values.join(', ')}]`;
@@ -293,8 +290,6 @@ class Vector {
293
290
  * @param {Number} [z] z component of the vector.
294
291
  * @chainable
295
292
  * @example
296
- * <div>
297
- * <code>
298
293
  * function setup() {
299
294
  * createCanvas(100, 100);
300
295
  *
@@ -326,8 +321,6 @@ class Vector {
326
321
  *
327
322
  * describe('Four black dots arranged in a square on a gray background.');
328
323
  * }
329
- * </code>
330
- * </div>
331
324
  */
332
325
  /**
333
326
  * @param {p5.Vector|Number[]} value vector to set.
@@ -351,8 +344,6 @@ class Vector {
351
344
  * @return {p5.Vector} copy of the <a href="#/p5.Vector">p5.Vector</a> object.
352
345
  *
353
346
  * @example
354
- * <div>
355
- * <code>
356
347
  * function setup() {
357
348
  * createCanvas(100 ,100);
358
349
  *
@@ -370,8 +361,6 @@ class Vector {
370
361
  *
371
362
  * describe('A black point drawn in the middle of a gray square.');
372
363
  * }
373
- * </code>
374
- * </div>
375
364
  */
376
365
  copy() {
377
366
  if (this.isPInst) {
@@ -404,8 +393,6 @@ class Vector {
404
393
  * @chainable
405
394
  *
406
395
  * @example
407
- * <div>
408
- * <code>
409
396
  * function setup() {
410
397
  * createCanvas(100, 100);
411
398
  *
@@ -437,11 +424,8 @@ class Vector {
437
424
  *
438
425
  * describe('Four black dots arranged in a square on a gray background.');
439
426
  * }
440
- * </code>
441
- * </div>
442
427
  *
443
- * <div>
444
- * <code>
428
+ * @example
445
429
  * function setup() {
446
430
  * createCanvas(100, 100);
447
431
  *
@@ -465,11 +449,8 @@ class Vector {
465
449
  *
466
450
  * describe('Three black dots in a diagonal line from top left to bottom right.');
467
451
  * }
468
- * </code>
469
- * </div>
470
452
  *
471
- * <div>
472
- * <code>
453
+ * @example
473
454
  * function setup() {
474
455
  * createCanvas(100, 100);
475
456
  *
@@ -508,8 +489,6 @@ class Vector {
508
489
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
509
490
  * pop();
510
491
  * }
511
- * </code>
512
- * </div>
513
492
  */
514
493
  /**
515
494
  * @param {p5.Vector|Number[]} value The vector to add
@@ -550,8 +529,7 @@ class Vector {
550
529
  * @chainable
551
530
  *
552
531
  * @example
553
- * <div class='norender'>
554
- * <code>
532
+ * // META:norender
555
533
  * function setup() {
556
534
  * // Create a p5.Vector object.
557
535
  * let v = createVector(3, 4, 5);
@@ -562,11 +540,9 @@ class Vector {
562
540
  * // Prints 'p5.Vector Object : [1, 0, 1]'.
563
541
  * print(v.toString());
564
542
  * }
565
- * </code>
566
- * </div>
567
543
  *
568
- * <div class='norender'>
569
- * <code>
544
+ * @example
545
+ * // META:norender
570
546
  * function setup() {
571
547
  * // Create a p5.Vector object.
572
548
  * let v = createVector(3, 4, 5);
@@ -577,11 +553,9 @@ class Vector {
577
553
  * // Prints 'p5.Vector Object : [1, 1, 5]'.
578
554
  * print(v.toString());
579
555
  * }
580
- * </code>
581
- * </div>
582
556
  *
583
- * <div class='norender'>
584
- * <code>
557
+ * @example
558
+ * // META:norender
585
559
  * function setup() {
586
560
  * // Create a p5.Vector object.
587
561
  * let v = createVector(3, 4, 5);
@@ -592,11 +566,9 @@ class Vector {
592
566
  * // Prints 'p5.Vector Object : [1, 1, 1]'.
593
567
  * print(v.toString());
594
568
  * }
595
- * </code>
596
- * </div>
597
569
  *
598
- * <div class='norender'>
599
- * <code>
570
+ * @example
571
+ * // META:norender
600
572
  * function setup() {
601
573
  * // Create p5.Vector objects.
602
574
  * let v1 = createVector(3, 4, 5);
@@ -608,11 +580,9 @@ class Vector {
608
580
  * // Prints 'p5.Vector Object : [1, 1, 1]'.
609
581
  * print(v1.toString());
610
582
  * }
611
- * </code>
612
- * </div>
613
583
  *
614
- * <div class='norender'>
615
- * <code>
584
+ * @example
585
+ * // META:norender
616
586
  * function setup() {
617
587
  * // Create a p5.Vector object.
618
588
  * let v = createVector(3, 4, 5);
@@ -624,11 +594,9 @@ class Vector {
624
594
  * // Prints 'p5.Vector Object : [1, 1, 1]'.
625
595
  * print(v.toString());
626
596
  * }
627
- * </code>
628
- * </div>
629
597
  *
630
- * <div class="norender">
631
- * <code>
598
+ * @example
599
+ * // META:norender
632
600
  * function setup() {
633
601
  * // Create p5.Vector objects.
634
602
  * let v1 = createVector(3, 4, 5);
@@ -640,8 +608,6 @@ class Vector {
640
608
  * // Prints 'p5.Vector Object : [1, 1, 1]'.
641
609
  * print(v3.toString());
642
610
  * }
643
- * </code>
644
- * </div>
645
611
  */
646
612
  /**
647
613
  * @param {p5.Vector | Number[]} value divisor vector.
@@ -723,8 +689,6 @@ class Vector {
723
689
  * @chainable
724
690
  *
725
691
  * @example
726
- * <div>
727
- * <code>
728
692
  * function setup() {
729
693
  * createCanvas(100, 100);
730
694
  *
@@ -756,11 +720,8 @@ class Vector {
756
720
  *
757
721
  * describe('Four black dots arranged in a square on a gray background.');
758
722
  * }
759
- * </code>
760
- * </div>
761
723
  *
762
- * <div>
763
- * <code>
724
+ * @example
764
725
  * function setup() {
765
726
  * createCanvas(100, 100);
766
727
  *
@@ -781,11 +742,8 @@ class Vector {
781
742
  *
782
743
  * describe('Three black dots in a diagonal line from top left to bottom right.');
783
744
  * }
784
- * </code>
785
- * </div>
786
745
  *
787
- * <div>
788
- * <code>
746
+ * @example
789
747
  * function setup() {
790
748
  * createCanvas(100, 100);
791
749
  *
@@ -824,8 +782,6 @@ class Vector {
824
782
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
825
783
  * pop();
826
784
  * }
827
- * </code>
828
- * </div>
829
785
  */
830
786
  /**
831
787
  * @param {p5.Vector|Number[]} value the vector to subtract
@@ -868,8 +824,6 @@ class Vector {
868
824
  * @param {Number} n The number to multiply with the vector
869
825
  * @chainable
870
826
  * @example
871
- * <div>
872
- * <code>
873
827
  * function setup() {
874
828
  * createCanvas(100, 100);
875
829
  *
@@ -889,11 +843,8 @@ class Vector {
889
843
  *
890
844
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.');
891
845
  * }
892
- * </code>
893
- * </div>
894
846
  *
895
- * <div>
896
- * <code>
847
+ * @example
897
848
  * function setup() {
898
849
  * strokeWeight(5);
899
850
  *
@@ -908,11 +859,8 @@ class Vector {
908
859
  *
909
860
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.');
910
861
  * }
911
- * </code>
912
- * </div>
913
862
  *
914
- * <div>
915
- * <code>
863
+ * @example
916
864
  * function setup() {
917
865
  * createCanvas(100, 100);
918
866
  *
@@ -933,11 +881,8 @@ class Vector {
933
881
  *
934
882
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.');
935
883
  * }
936
- * </code>
937
- * </div>
938
884
  *
939
- * <div>
940
- * <code>
885
+ * @example
941
886
  * function setup() {
942
887
  * createCanvas(100, 100);
943
888
  *
@@ -958,11 +903,8 @@ class Vector {
958
903
  *
959
904
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.');
960
905
  * }
961
- * </code>
962
- * </div>
963
906
  *
964
- * <div>
965
- * <code>
907
+ * @example
966
908
  * function setup() {
967
909
  * createCanvas(100, 100);
968
910
  *
@@ -985,11 +927,8 @@ class Vector {
985
927
  *
986
928
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.');
987
929
  * }
988
- * </code>
989
- * </div>
990
930
  *
991
- * <div>
992
- * <code>
931
+ * @example
993
932
  * function setup() {
994
933
  * createCanvas(100, 100);
995
934
  *
@@ -1024,8 +963,6 @@ class Vector {
1024
963
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
1025
964
  * pop();
1026
965
  * }
1027
- * </code>
1028
- * </div>
1029
966
  */
1030
967
  /**
1031
968
  * @param {Number} x number to multiply with the x component of the vector.
@@ -1102,8 +1039,6 @@ class Vector {
1102
1039
  * @param {Number} n The number to divide the vector by
1103
1040
  * @chainable
1104
1041
  * @example
1105
- * <div>
1106
- * <code>
1107
1042
  * function setup() {
1108
1043
  * createCanvas(100, 100);
1109
1044
  *
@@ -1123,11 +1058,8 @@ class Vector {
1123
1058
  *
1124
1059
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.');
1125
1060
  * }
1126
- * </code>
1127
- * </div>
1128
1061
  *
1129
- * <div>
1130
- * <code>
1062
+ * @example
1131
1063
  * function setup() {
1132
1064
  * createCanvas(100, 100);
1133
1065
  *
@@ -1147,11 +1079,8 @@ class Vector {
1147
1079
  *
1148
1080
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.');
1149
1081
  * }
1150
- * </code>
1151
- * </div>
1152
1082
  *
1153
- * <div>
1154
- * <code>
1083
+ * @example
1155
1084
  * function setup() {
1156
1085
  * createCanvas(100, 100);
1157
1086
  *
@@ -1172,11 +1101,8 @@ class Vector {
1172
1101
  *
1173
1102
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.');
1174
1103
  * }
1175
- * </code>
1176
- * </div>
1177
1104
  *
1178
- * <div>
1179
- * <code>
1105
+ * @example
1180
1106
  * function setup() {
1181
1107
  * createCanvas(100, 100);
1182
1108
  *
@@ -1197,11 +1123,8 @@ class Vector {
1197
1123
  *
1198
1124
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.');
1199
1125
  * }
1200
- * </code>
1201
- * </div>
1202
1126
  *
1203
- * <div>
1204
- * <code>
1127
+ * @example
1205
1128
  * function setup() {
1206
1129
  * createCanvas(100, 100);
1207
1130
  *
@@ -1224,11 +1147,8 @@ class Vector {
1224
1147
  *
1225
1148
  * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.');
1226
1149
  * }
1227
- * </code>
1228
- * </div>
1229
1150
  *
1230
- * <div>
1231
- * <code>
1151
+ * @example
1232
1152
  * function draw() {
1233
1153
  * background(200);
1234
1154
  *
@@ -1259,8 +1179,6 @@ class Vector {
1259
1179
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
1260
1180
  * pop();
1261
1181
  * }
1262
- * </code>
1263
- * </div>
1264
1182
  */
1265
1183
  /**
1266
1184
  * @param {Number} x number to divide with the x component of the vector.
@@ -1341,8 +1259,6 @@ class Vector {
1341
1259
  * @return {Number} magnitude of the vector.
1342
1260
  *
1343
1261
  * @example
1344
- * <div>
1345
- * <code>
1346
1262
  * function setup() {
1347
1263
  * createCanvas(100, 100);
1348
1264
  *
@@ -1364,8 +1280,6 @@ class Vector {
1364
1280
  *
1365
1281
  * describe('A diagonal black line extends from the top left corner of a gray square. The number 50 is written at the end of the line.');
1366
1282
  * }
1367
- * </code>
1368
- * </div>
1369
1283
  */
1370
1284
  mag() {
1371
1285
  return Math.sqrt(this.magSq());
@@ -1376,8 +1290,6 @@ class Vector {
1376
1290
  *
1377
1291
  * @return {Number} squared magnitude of the vector.
1378
1292
  * @example
1379
- * <div>
1380
- * <code>
1381
1293
  * function setup() {
1382
1294
  * createCanvas(100, 100);
1383
1295
  *
@@ -1399,8 +1311,6 @@ class Vector {
1399
1311
  *
1400
1312
  * describe('A diagonal black line extends from the top left corner of a gray square. The number 2500 is written at the end of the line.');
1401
1313
  * }
1402
- * </code>
1403
- * </div>
1404
1314
  */
1405
1315
  magSq() {
1406
1316
  return this._values.reduce(
@@ -1433,8 +1343,7 @@ class Vector {
1433
1343
  * @return {Number} dot product.
1434
1344
  *
1435
1345
  * @example
1436
- * <div class="norender">
1437
- * <code>
1346
+ * // META:norender
1438
1347
  * function setup() {
1439
1348
  * // Create p5.Vector objects.
1440
1349
  * let v1 = createVector(3, 4);
@@ -1446,11 +1355,9 @@ class Vector {
1446
1355
  * // Prints "9" to the console.
1447
1356
  * print(dp);
1448
1357
  * }
1449
- * </code>
1450
- * </div>
1451
1358
  *
1452
- * <div class="norender">
1453
- * <code>
1359
+ * @example
1360
+ * // META:norender
1454
1361
  * function setup() {
1455
1362
  * // Create p5.Vector objects.
1456
1363
  * let v1 = createVector(1, 0);
@@ -1462,11 +1369,8 @@ class Vector {
1462
1369
  * // Prints "0" to the console.
1463
1370
  * print(dp);
1464
1371
  * }
1465
- * </code>
1466
- * </div>
1467
1372
  *
1468
- * <div>
1469
- * <code>
1373
+ * @example
1470
1374
  * function setup() {
1471
1375
  * createCanvas(100, 100);
1472
1376
  *
@@ -1506,8 +1410,6 @@ class Vector {
1506
1410
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
1507
1411
  * pop();
1508
1412
  * }
1509
- * </code>
1510
- * </div>
1511
1413
  */
1512
1414
  /**
1513
1415
  * @param {p5.Vector} v <a href="#/p5.Vector">p5.Vector</a> to be dotted.
@@ -1536,8 +1438,7 @@ class Vector {
1536
1438
  * @return {p5.Vector} cross product as a <a href="#/p5.Vector">p5.Vector</a>.
1537
1439
  *
1538
1440
  * @example
1539
- * <div class="norender">
1540
- * <code>
1441
+ * // META:norender
1541
1442
  * function setup() {
1542
1443
  * // Create p5.Vector objects.
1543
1444
  * let v1 = createVector(1, 0);
@@ -1549,11 +1450,9 @@ class Vector {
1549
1450
  * // Prints "p5.Vector Object : [0, 0, 4]" to the console.
1550
1451
  * print(cp.toString());
1551
1452
  * }
1552
- * </code>
1553
- * </div>
1554
1453
  *
1555
- * <div class="norender">
1556
- * <code>
1454
+ * @example
1455
+ * // META:norender
1557
1456
  * function setup() {
1558
1457
  * // Create p5.Vector objects.
1559
1458
  * let v1 = createVector(1, 0);
@@ -1565,8 +1464,6 @@ class Vector {
1565
1464
  * // Prints "p5.Vector Object : [0, 0, 4]" to the console.
1566
1465
  * print(cp.toString());
1567
1466
  * }
1568
- * </code>
1569
- * </div>
1570
1467
  */
1571
1468
  cross(v) {
1572
1469
  const x = this.y * v.z - this.z * v.y;
@@ -1596,8 +1493,7 @@ class Vector {
1596
1493
  * @return {Number} distance.
1597
1494
  *
1598
1495
  * @example
1599
- * <div class="norender">
1600
- * <code>
1496
+ * // META:norender
1601
1497
  * function setup() {
1602
1498
  * createCanvas(100, 100);
1603
1499
  *
@@ -1613,11 +1509,9 @@ class Vector {
1613
1509
  * // Prints "1.414..." to the console.
1614
1510
  * print(d);
1615
1511
  * }
1616
- * </code>
1617
- * </div>
1618
1512
  *
1619
- * <div class="norender">
1620
- * <code>
1513
+ * @example
1514
+ * // META:norender
1621
1515
  * function setup() {
1622
1516
  * createCanvas(100, 100);
1623
1517
  *
@@ -1633,11 +1527,8 @@ class Vector {
1633
1527
  * // Prints "1.414..." to the console.
1634
1528
  * print(d);
1635
1529
  * }
1636
- * </code>
1637
- * </div>
1638
1530
  *
1639
- * <div>
1640
- * <code>
1531
+ * @example
1641
1532
  * function setup() {
1642
1533
  * createCanvas(100, 100);
1643
1534
  *
@@ -1683,8 +1574,6 @@ class Vector {
1683
1574
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
1684
1575
  * pop();
1685
1576
  * }
1686
- * </code>
1687
- * </div>
1688
1577
  */
1689
1578
  dist(v) {
1690
1579
  return v.copy().sub(this).mag();
@@ -1701,8 +1590,7 @@ class Vector {
1701
1590
  * @return {p5.Vector} normalized <a href="#/p5.Vector">p5.Vector</a>.
1702
1591
  *
1703
1592
  * @example
1704
- * <div class="norender">
1705
- * <code>
1593
+ * // META:norender
1706
1594
  * function setup() {
1707
1595
  * createCanvas(100, 100);
1708
1596
  *
@@ -1717,11 +1605,9 @@ class Vector {
1717
1605
  * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console.
1718
1606
  * print(v.toString());
1719
1607
  * }
1720
- * </code>
1721
- * </div>
1722
1608
  *
1723
- * <div class="norender">
1724
- * <code>
1609
+ * @example
1610
+ * // META:norender
1725
1611
  * function setup() {
1726
1612
  * createCanvas(100, 100);
1727
1613
  *
@@ -1738,11 +1624,8 @@ class Vector {
1738
1624
  * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console.
1739
1625
  * print(v1.toString());
1740
1626
  * }
1741
- * </code>
1742
- * </div>
1743
1627
  *
1744
- * <div>
1745
- * <code>
1628
+ * @example
1746
1629
  * function setup() {
1747
1630
  * createCanvas(100, 100);
1748
1631
  *
@@ -1787,8 +1670,6 @@ class Vector {
1787
1670
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
1788
1671
  * pop();
1789
1672
  * }
1790
- * </code>
1791
- * </div>
1792
1673
  */
1793
1674
  normalize() {
1794
1675
  const len = this.mag();
@@ -1809,8 +1690,7 @@ class Vector {
1809
1690
  * @chainable
1810
1691
  *
1811
1692
  * @example
1812
- * <div class="norender">
1813
- * <code>
1693
+ * // META:norender
1814
1694
  * function setup() {
1815
1695
  * // Create a p5.Vector object.
1816
1696
  * let v = createVector(10, 20, 2);
@@ -1821,11 +1701,9 @@ class Vector {
1821
1701
  * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console.
1822
1702
  * print(v.toString());
1823
1703
  * }
1824
- * </code>
1825
- * </div>
1826
1704
  *
1827
- * <div class="norender">
1828
- * <code>
1705
+ * @example
1706
+ * // META:norender
1829
1707
  * function setup() {
1830
1708
  * // Create a p5.Vector object.
1831
1709
  * let v0 = createVector(10, 20, 2);
@@ -1836,11 +1714,8 @@ class Vector {
1836
1714
  * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console.
1837
1715
  * print(v1.toString());
1838
1716
  * }
1839
- * </code>
1840
- * </div>
1841
1717
  *
1842
- * <div>
1843
- * <code>
1718
+ * @example
1844
1719
  * function setup() {
1845
1720
  * createCanvas(100, 100);
1846
1721
  *
@@ -1883,8 +1758,6 @@ class Vector {
1883
1758
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
1884
1759
  * pop();
1885
1760
  * }
1886
- * </code>
1887
- * </div>
1888
1761
  */
1889
1762
  limit(max) {
1890
1763
  const mSq = this.magSq();
@@ -1906,8 +1779,7 @@ class Vector {
1906
1779
  * @chainable
1907
1780
  *
1908
1781
  * @example
1909
- * <div class="norender">
1910
- * <code>
1782
+ * // META:norender
1911
1783
  * function setup() {
1912
1784
  * // Create a p5.Vector object.
1913
1785
  * let v = createVector(3, 4, 0);
@@ -1921,11 +1793,9 @@ class Vector {
1921
1793
  * // Prints "p5.Vector Object : [6, 8, 0]" to the console.
1922
1794
  * print(v.toString());
1923
1795
  * }
1924
- * </code>
1925
- * </div>
1926
1796
  *
1927
- * <div class="norender">
1928
- * <code>
1797
+ * @example
1798
+ * // META:norender
1929
1799
  * function setup() {
1930
1800
  * // Create a p5.Vector object.
1931
1801
  * let v0 = createVector(3, 4, 0);
@@ -1939,11 +1809,8 @@ class Vector {
1939
1809
  * // Prints "p5.Vector Object : [6, 8, 0]" to the console.
1940
1810
  * print(v1.toString());
1941
1811
  * }
1942
- * </code>
1943
- * </div>
1944
1812
  *
1945
- * <div>
1946
- * <code>
1813
+ * @example
1947
1814
  * function setup() {
1948
1815
  * createCanvas(100, 100);
1949
1816
  *
@@ -1980,8 +1847,6 @@ class Vector {
1980
1847
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
1981
1848
  * pop();
1982
1849
  * }
1983
- * </code>
1984
- * </div>
1985
1850
  */
1986
1851
  setMag(n) {
1987
1852
  return this.normalize().mult(n);
@@ -2003,8 +1868,7 @@ class Vector {
2003
1868
  * @return {Number} angle of rotation.
2004
1869
  *
2005
1870
  * @example
2006
- * <div class = "norender">
2007
- * <code>
1871
+ * // META:norender
2008
1872
  * function setup() {
2009
1873
  * // Create a p5.Vector object.
2010
1874
  * let v = createVector(1, 1);
@@ -2018,11 +1882,9 @@ class Vector {
2018
1882
  * // Prints "45" to the console.
2019
1883
  * print(v.heading());
2020
1884
  * }
2021
- * </code>
2022
- * </div>
2023
1885
  *
2024
- * <div class = "norender">
2025
- * <code>
1886
+ * @example
1887
+ * // META:norender
2026
1888
  * function setup() {
2027
1889
  * // Create a p5.Vector object.
2028
1890
  * let v = createVector(1, 1);
@@ -2036,11 +1898,8 @@ class Vector {
2036
1898
  * // Prints "45" to the console.
2037
1899
  * print(p5.Vector.heading(v));
2038
1900
  * }
2039
- * </code>
2040
- * </div>
2041
1901
  *
2042
- * <div>
2043
- * <code>
1902
+ * @example
2044
1903
  * function setup() {
2045
1904
  * createCanvas(100, 100);
2046
1905
  *
@@ -2085,8 +1944,6 @@ class Vector {
2085
1944
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
2086
1945
  * pop();
2087
1946
  * }
2088
- * </code>
2089
- * </div>
2090
1947
  */
2091
1948
  heading() {
2092
1949
  const h = Math.atan2(this.y, this.x);
@@ -2107,8 +1964,7 @@ class Vector {
2107
1964
  * @param {Number} angle angle of rotation.
2108
1965
  * @chainable
2109
1966
  * @example
2110
- * <div class="norender">
2111
- * <code>
1967
+ * // META:norender
2112
1968
  * function setup() {
2113
1969
  * // Create a p5.Vector object.
2114
1970
  * let v = createVector(0, 1);
@@ -2122,11 +1978,9 @@ class Vector {
2122
1978
  * // Prints "3.141..." to the console.
2123
1979
  * print(v.heading());
2124
1980
  * }
2125
- * </code>
2126
- * </div>
2127
1981
  *
2128
- * <div class="norender">
2129
- * <code>
1982
+ * @example
1983
+ * // META:norender
2130
1984
  * function setup() {
2131
1985
  * // Use degrees.
2132
1986
  * angleMode(DEGREES);
@@ -2143,11 +1997,8 @@ class Vector {
2143
1997
  * // Prints "180" to the console.
2144
1998
  * print(v.heading());
2145
1999
  * }
2146
- * </code>
2147
- * </div>
2148
2000
  *
2149
- * <div>
2150
- * <code>
2001
+ * @example
2151
2002
  * function setup() {
2152
2003
  * createCanvas(100, 100);
2153
2004
  *
@@ -2185,8 +2036,6 @@ class Vector {
2185
2036
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
2186
2037
  * pop();
2187
2038
  * }
2188
- * </code>
2189
- * </div>
2190
2039
  */
2191
2040
  setHeading(a) {
2192
2041
  if (this.isPInst) a = this._toRadians(a);
@@ -2213,8 +2062,7 @@ class Vector {
2213
2062
  * @param {Number} angle angle of rotation.
2214
2063
  * @chainable
2215
2064
  * @example
2216
- * <div class="norender">
2217
- * <code>
2065
+ * // META:norender
2218
2066
  * function setup() {
2219
2067
  * // Create a p5.Vector object.
2220
2068
  * let v = createVector(1, 0);
@@ -2228,11 +2076,9 @@ class Vector {
2228
2076
  * // Prints "p5.Vector Object : [0, 1, 0]" to the console.
2229
2077
  * print(v.toString());
2230
2078
  * }
2231
- * </code>
2232
- * </div>
2233
2079
  *
2234
- * <div class="norender">
2235
- * <code>
2080
+ * @example
2081
+ * // META:norender
2236
2082
  * function setup() {
2237
2083
  * // Use degrees.
2238
2084
  * angleMode(DEGREES);
@@ -2249,11 +2095,9 @@ class Vector {
2249
2095
  * // Prints "p5.Vector Object : [0, 1, 0]" to the console.
2250
2096
  * print(v.toString());
2251
2097
  * }
2252
- * </code>
2253
- * </div>
2254
2098
  *
2255
- * <div class="norender">
2256
- * <code>
2099
+ * @example
2100
+ * // META:norender
2257
2101
  * function setup() {
2258
2102
  * // Create a p5.Vector object.
2259
2103
  * let v0 = createVector(1, 0);
@@ -2266,11 +2110,9 @@ class Vector {
2266
2110
  * // Prints "p5.Vector Object : [0, 1, 0]" to the console.
2267
2111
  * print(v1.toString());
2268
2112
  * }
2269
- * </code>
2270
- * </div>
2271
2113
  *
2272
- * <div class="norender">
2273
- * <code>
2114
+ * @example
2115
+ * // META:norender
2274
2116
  * function setup() {
2275
2117
  * // Use degrees.
2276
2118
  * angleMode(DEGREES);
@@ -2287,11 +2129,8 @@ class Vector {
2287
2129
  * // Prints "p5.Vector Object : [0, 1, 0]" to the console.
2288
2130
  * print(v1.toString());
2289
2131
  * }
2290
- * </code>
2291
- * </div>
2292
2132
  *
2293
- * <div>
2294
- * <code>
2133
+ * @example
2295
2134
  * let v0;
2296
2135
  * let v1;
2297
2136
  *
@@ -2329,8 +2168,6 @@ class Vector {
2329
2168
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
2330
2169
  * pop();
2331
2170
  * }
2332
- * </code>
2333
- * </div>
2334
2171
  */
2335
2172
  rotate(a) {
2336
2173
  let newHeading = this.heading() + a;
@@ -2355,8 +2192,7 @@ class Vector {
2355
2192
  * @param {p5.Vector} value x, y, and z components of a <a href="#/p5.Vector">p5.Vector</a>.
2356
2193
  * @return {Number} angle between the vectors.
2357
2194
  * @example
2358
- * <div class="norender">
2359
- * <code>
2195
+ * // META:norender
2360
2196
  * function setup() {
2361
2197
  * // Create p5.Vector objects.
2362
2198
  * let v0 = createVector(1, 0);
@@ -2368,11 +2204,9 @@ class Vector {
2368
2204
  * // Prints "-1.570..." to the console.
2369
2205
  * print(v1.angleBetween(v0));
2370
2206
  * }
2371
- * </code>
2372
- * </div>
2373
2207
  *
2374
- * <div class="norender">
2375
- * <code>
2208
+ * @example
2209
+ * // META:norender
2376
2210
  * function setup() {
2377
2211
  * // Use degrees.
2378
2212
  * angleMode(DEGREES);
@@ -2386,11 +2220,9 @@ class Vector {
2386
2220
  * // Prints "-90" to the console.
2387
2221
  * print(v1.angleBetween(v0));
2388
2222
  * }
2389
- * </code>
2390
- * </div>
2391
2223
  *
2392
- * <div class="norender">
2393
- * <code>
2224
+ * @example
2225
+ * // META:norender
2394
2226
  * function setup() {
2395
2227
  * // Create p5.Vector objects.
2396
2228
  * let v0 = createVector(1, 0);
@@ -2402,11 +2234,9 @@ class Vector {
2402
2234
  * // Prints "-1.570..." to the console.
2403
2235
  * print(p5.Vector.angleBetween(v1, v0));
2404
2236
  * }
2405
- * </code>
2406
- * </div>
2407
2237
  *
2408
- * <div class="norender">
2409
- * <code>
2238
+ * @example
2239
+ * // META:norender
2410
2240
  * function setup() {
2411
2241
  * // Use degrees.
2412
2242
  * angleMode(DEGREES);
@@ -2421,11 +2251,8 @@ class Vector {
2421
2251
  * // Prints "-90" to the console.
2422
2252
  * print(p5.Vector.angleBetween(v1, v0));
2423
2253
  * }
2424
- * </code>
2425
- * </div>
2426
2254
  *
2427
- * <div>
2428
- * <code>
2255
+ * @example
2429
2256
  * function setup() {
2430
2257
  * createCanvas(100, 100);
2431
2258
  *
@@ -2474,8 +2301,6 @@ class Vector {
2474
2301
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
2475
2302
  * pop();
2476
2303
  * }
2477
- * </code>
2478
- * </div>
2479
2304
  */
2480
2305
  angleBetween(v) {
2481
2306
  const magSqMult = this.magSq() * v.magSq();
@@ -2514,8 +2339,7 @@ class Vector {
2514
2339
  * @chainable
2515
2340
  *
2516
2341
  * @example
2517
- * <div class="norender">
2518
- * <code>
2342
+ * // META:norender
2519
2343
  * function setup() {
2520
2344
  * // Create a p5.Vector object.
2521
2345
  * let v0 = createVector(1, 1, 1);
@@ -2527,11 +2351,9 @@ class Vector {
2527
2351
  * // Prints "p5.Vector Object : [2, 2, 2]" to the console.
2528
2352
  * print(v0.toString());
2529
2353
  * }
2530
- * </code>
2531
- * </div>
2532
2354
  *
2533
- * <div class="norender">
2534
- * <code>
2355
+ * @example
2356
+ * // META:norender
2535
2357
  * function setup() {
2536
2358
  * // Create a p5.Vector object.
2537
2359
  * let v = createVector(1, 1, 1);
@@ -2542,11 +2364,9 @@ class Vector {
2542
2364
  * // Prints "p5.Vector Object : [2, 2, 2]" to the console.
2543
2365
  * print(v.toString());
2544
2366
  * }
2545
- * </code>
2546
- * </div>
2547
2367
  *
2548
- * <div class="norender">
2549
- * <code>
2368
+ * @example
2369
+ * // META:norender
2550
2370
  * function setup() {
2551
2371
  * // Create p5.Vector objects.
2552
2372
  * let v0 = createVector(1, 1, 1);
@@ -2558,11 +2378,8 @@ class Vector {
2558
2378
  * // Prints "p5.Vector Object : [2, 2, 2]" to the console.
2559
2379
  * print(v2.toString());
2560
2380
  * }
2561
- * </code>
2562
- * </div>
2563
2381
  *
2564
- * <div>
2565
- * <code>
2382
+ * @example
2566
2383
  * function setup() {
2567
2384
  * createCanvas(100, 100);
2568
2385
  *
@@ -2603,8 +2420,6 @@ class Vector {
2603
2420
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
2604
2421
  * pop();
2605
2422
  * }
2606
- * </code>
2607
- * </div>
2608
2423
  */
2609
2424
  /**
2610
2425
  * @param {p5.Vector} v <a href="#/p5.Vector">p5.Vector</a> to lerp toward.
@@ -2644,8 +2459,7 @@ class Vector {
2644
2459
  * @return {p5.Vector}
2645
2460
  *
2646
2461
  * @example
2647
- * <div class="norender">
2648
- * <code>
2462
+ * // META:norender
2649
2463
  * function setup() {
2650
2464
  * // Create a p5.Vector object.
2651
2465
  * let v0 = createVector(3, 0);
@@ -2674,11 +2488,9 @@ class Vector {
2674
2488
  * // Prints "0.785..." to the console.
2675
2489
  * print(v0.heading());
2676
2490
  * }
2677
- * </code>
2678
- * </div>
2679
2491
  *
2680
- * <div class="norender">
2681
- * <code>
2492
+ * @example
2493
+ * // META:norender
2682
2494
  * function setup() {
2683
2495
  * // Create a p5.Vector object.
2684
2496
  * let v0 = createVector(3, 0);
@@ -2707,11 +2519,8 @@ class Vector {
2707
2519
  * // Prints "0.785..." to the console.
2708
2520
  * print(v3.heading());
2709
2521
  * }
2710
- * </code>
2711
- * </div>
2712
2522
  *
2713
- * <div>
2714
- * <code>
2523
+ * @example
2715
2524
  * function setup() {
2716
2525
  * createCanvas(100, 100);
2717
2526
  *
@@ -2753,8 +2562,6 @@ class Vector {
2753
2562
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
2754
2563
  * pop();
2755
2564
  * }
2756
- * </code>
2757
- * </div>
2758
2565
  */
2759
2566
  slerp(v, amt) {
2760
2567
  // edge cases.
@@ -2840,8 +2647,7 @@ class Vector {
2840
2647
  * to reflect about.
2841
2648
  * @chainable
2842
2649
  * @example
2843
- * <div class="norender">
2844
- * <code>
2650
+ * // META:norender
2845
2651
  * function setup() {
2846
2652
  * // Create a normal vector.
2847
2653
  * let n = createVector(0, 1);
@@ -2854,11 +2660,9 @@ class Vector {
2854
2660
  * // Prints "p5.Vector Object : [4, -6, 0]" to the console.
2855
2661
  * print(v.toString());
2856
2662
  * }
2857
- * </code>
2858
- * </div>
2859
2663
  *
2860
- * <div class="norender">
2861
- * <code>
2664
+ * @example
2665
+ * // META:norender
2862
2666
  * function setup() {
2863
2667
  * // Create a normal vector.
2864
2668
  * let n = createVector(0, 1);
@@ -2872,11 +2676,8 @@ class Vector {
2872
2676
  * // Prints "p5.Vector Object : [4, -6, 0]" to the console.
2873
2677
  * print(v1.toString());
2874
2678
  * }
2875
- * </code>
2876
- * </div>
2877
2679
  *
2878
- * <div>
2879
- * <code>
2680
+ * @example
2880
2681
  * function setup() {
2881
2682
  * createCanvas(100, 100);
2882
2683
  *
@@ -2927,8 +2728,6 @@ class Vector {
2927
2728
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
2928
2729
  * pop();
2929
2730
  * }
2930
- * </code>
2931
- * </div>
2932
2731
  */
2933
2732
  reflect(surfaceNormal) {
2934
2733
  const surfaceNormalCopy = Vector.normalize(surfaceNormal);
@@ -2940,8 +2739,7 @@ class Vector {
2940
2739
  *
2941
2740
  * @return {Number[]} array with the vector's components.
2942
2741
  * @example
2943
- * <div class = "norender">
2944
- * <code>
2742
+ * // META:norender
2945
2743
  * function setup() {
2946
2744
  * // Create a p5.Vector object.
2947
2745
  * let v = createVector(20, 30);
@@ -2949,8 +2747,6 @@ class Vector {
2949
2747
  * // Prints "[20, 30, 0]" to the console.
2950
2748
  * print(v.array());
2951
2749
  * }
2952
- * </code>
2953
- * </div>
2954
2750
  */
2955
2751
  array() {
2956
2752
  return [this.x || 0, this.y || 0, this.z || 0];
@@ -2977,8 +2773,7 @@ class Vector {
2977
2773
  * @param {Number} [z] z component of the vector.
2978
2774
  * @return {Boolean} whether the vectors are equal.
2979
2775
  * @example
2980
- * <div class="norender">
2981
- * <code>
2776
+ * // META:norender
2982
2777
  * function setup() {
2983
2778
  * // Create p5.Vector objects.
2984
2779
  * let v0 = createVector(10, 20, 30);
@@ -2991,11 +2786,9 @@ class Vector {
2991
2786
  * // Prints "false" to the console.
2992
2787
  * print(v0.equals(v2));
2993
2788
  * }
2994
- * </code>
2995
- * </div>
2996
2789
  *
2997
- * <div class = "norender">
2998
- * <code>
2790
+ * @example
2791
+ * // META:norender
2999
2792
  * function setup() {
3000
2793
  * // Create p5.Vector objects.
3001
2794
  * let v0 = createVector(5, 10, 20);
@@ -3008,11 +2801,9 @@ class Vector {
3008
2801
  * // Prints "false" to the console.
3009
2802
  * print(v0.equals(v2.x, v2.y, v2.z));
3010
2803
  * }
3011
- * </code>
3012
- * </div>
3013
2804
  *
3014
- * <div class="norender">
3015
- * <code>
2805
+ * @example
2806
+ * // META:norender
3016
2807
  * function setup() {
3017
2808
  * // Create p5.Vector objects.
3018
2809
  * let v0 = createVector(10, 20, 30);
@@ -3025,8 +2816,6 @@ class Vector {
3025
2816
  * // Prints "false" to the console.
3026
2817
  * print(p5.Vector.equals(v0, v2));
3027
2818
  * }
3028
- * </code>
3029
- * </div>
3030
2819
  */
3031
2820
  /**
3032
2821
  * @param {p5.Vector|Array} value vector to compare.
@@ -3088,8 +2877,7 @@ class Vector {
3088
2877
  * @return {p5.Vector} new <a href="#/p5.Vector">p5.Vector</a> object.
3089
2878
  *
3090
2879
  * @example
3091
- * <div class="norender">
3092
- * <code>
2880
+ * // META:norender
3093
2881
  * function setup() {
3094
2882
  * // Create a p5.Vector object.
3095
2883
  * let v = p5.Vector.fromAngle(0);
@@ -3097,11 +2885,9 @@ class Vector {
3097
2885
  * // Prints "p5.Vector Object : [1, 0, 0]" to the console.
3098
2886
  * print(v.toString());
3099
2887
  * }
3100
- * </code>
3101
- * </div>
3102
2888
  *
3103
- * <div class="norender">
3104
- * <code>
2889
+ * @example
2890
+ * // META:norender
3105
2891
  * function setup() {
3106
2892
  * // Create a p5.Vector object.
3107
2893
  * let v = p5.Vector.fromAngle(0, 30);
@@ -3109,11 +2895,8 @@ class Vector {
3109
2895
  * // Prints "p5.Vector Object : [30, 0, 0]" to the console.
3110
2896
  * print(v.toString());
3111
2897
  * }
3112
- * </code>
3113
- * </div>
3114
2898
  *
3115
- * <div>
3116
- * <code>
2899
+ * @example
3117
2900
  * function setup() {
3118
2901
  * createCanvas(100, 100);
3119
2902
  *
@@ -3146,8 +2929,6 @@ class Vector {
3146
2929
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
3147
2930
  * pop();
3148
2931
  * }
3149
- * </code>
3150
- * </div>
3151
2932
  */
3152
2933
  static fromAngle(angle, length) {
3153
2934
  if (typeof length === 'undefined') {
@@ -3167,8 +2948,7 @@ class Vector {
3167
2948
  * @return {p5.Vector} new <a href="#/p5.Vector">p5.Vector</a> object.
3168
2949
  *
3169
2950
  * @example
3170
- * <div class="norender">
3171
- * <code>
2951
+ * // META:norender
3172
2952
  * function setup() {
3173
2953
  * // Create a p5.Vector object.
3174
2954
  * let v = p5.Vector.fromAngles(0, 0);
@@ -3176,11 +2956,8 @@ class Vector {
3176
2956
  * // Prints "p5.Vector Object : [0, -1, 0]" to the console.
3177
2957
  * print(v.toString());
3178
2958
  * }
3179
- * </code>
3180
- * </div>
3181
2959
  *
3182
- * <div>
3183
- * <code>
2960
+ * @example
3184
2961
  * function setup() {
3185
2962
  * createCanvas(100, 100, WEBGL);
3186
2963
  *
@@ -3208,8 +2985,6 @@ class Vector {
3208
2985
  * // Draw the sphere.
3209
2986
  * sphere(35);
3210
2987
  * }
3211
- * </code>
3212
- * </div>
3213
2988
  */
3214
2989
  static fromAngles(theta, phi, length) {
3215
2990
  if (typeof length === 'undefined') {
@@ -3233,8 +3008,7 @@ class Vector {
3233
3008
  * @static
3234
3009
  * @return {p5.Vector} new <a href="#/p5.Vector">p5.Vector</a> object.
3235
3010
  * @example
3236
- * <div class="norender">
3237
- * <code>
3011
+ * // META:norender
3238
3012
  * function setup() {
3239
3013
  * // Create a p5.Vector object.
3240
3014
  * let v = p5.Vector.random2D();
@@ -3243,11 +3017,8 @@ class Vector {
3243
3017
  * // where x and y are small random numbers.
3244
3018
  * print(v.toString());
3245
3019
  * }
3246
- * </code>
3247
- * </div>
3248
3020
  *
3249
- * <div>
3250
- * <code>
3021
+ * @example
3251
3022
  * function setup() {
3252
3023
  * createCanvas(100, 100);
3253
3024
  *
@@ -3287,8 +3058,6 @@ class Vector {
3287
3058
  * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0);
3288
3059
  * pop();
3289
3060
  * }
3290
- * </code>
3291
- * </div>
3292
3061
  */
3293
3062
  static random2D() {
3294
3063
  return this.fromAngle(Math.random() * TWO_PI);
@@ -3300,8 +3069,7 @@ class Vector {
3300
3069
  * @static
3301
3070
  * @return {p5.Vector} new <a href="#/p5.Vector">p5.Vector</a> object.
3302
3071
  * @example
3303
- * <div class="norender">
3304
- * <code>
3072
+ * // META:norender
3305
3073
  * function setup() {
3306
3074
  * // Create a p5.Vector object.
3307
3075
  * let v = p5.Vector.random3D();
@@ -3310,8 +3078,6 @@ class Vector {
3310
3078
  * // where x, y, and z are small random numbers.
3311
3079
  * print(v.toString());
3312
3080
  * }
3313
- * </code>
3314
- * </div>
3315
3081
  */
3316
3082
  static random3D() {
3317
3083
  const angle = Math.random() * TWO_PI;
@@ -3840,8 +3606,6 @@ function vector(p5, fn) {
3840
3606
  * @param {Number} [y] y component of the vector.
3841
3607
  * @param {Number} [z] z component of the vector.
3842
3608
  * @example
3843
- * <div>
3844
- * <code>
3845
3609
  * function setup() {
3846
3610
  * createCanvas(100, 100);
3847
3611
  *
@@ -3862,11 +3626,8 @@ function vector(p5, fn) {
3862
3626
  *
3863
3627
  * describe('Two black dots on a gray square, one at the top left and the other at the bottom right.');
3864
3628
  * }
3865
- * </code>
3866
- * </div>
3867
3629
  *
3868
- * <div>
3869
- * <code>
3630
+ * @example
3870
3631
  * let pos;
3871
3632
  * let vel;
3872
3633
  *
@@ -3896,8 +3657,6 @@ function vector(p5, fn) {
3896
3657
  * strokeWeight(5);
3897
3658
  * point(pos);
3898
3659
  * }
3899
- * </code>
3900
- * </div>
3901
3660
  */
3902
3661
  p5.Vector = Vector;
3903
3662