@@ -23,14 +23,14 @@ function matrix(p5, fn) {
23
23
* @param {Array } [mat4] column-major array literal of our 4×4 matrix
24
24
* @example
25
25
* // Creating a 3x3 matrix from an array using column major arrangement
26
- * const matrix = new Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
26
+ * const matrix = new p5. Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
27
27
*
28
28
* // Creating a 4x4 identity matrix
29
- * const identityMatrix = new Matrix(4);
29
+ * const identityMatrix = new p5. Matrix(4);
30
30
*
31
31
* // Adding two matrices
32
- * const matrix1 = new Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
33
- * const matrix2 = new Matrix([9, 8, 7, 6, 5, 4, 3, 2, 1]);
32
+ * const matrix1 = new p5. Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
33
+ * const matrix2 = new p5. Matrix([9, 8, 7, 6, 5, 4, 3, 2, 1]);
34
34
* matrix1.add(matrix2); // matrix1 is now [10, 10, 10, 10, 10, 10, 10, 10, 10]
35
35
*
36
36
* // Setting an element in the matrix
@@ -72,30 +72,30 @@ function matrix(p5, fn) {
72
72
* function setup() {
73
73
*
74
74
* // Create a 4x4 identity matrix
75
- * const matrix = new Matrix(4);
76
- * console.log("Original Matrix:", matrix.matrix);
75
+ * const matrix = new p5. Matrix(4);
76
+ * console.log("Original p5. Matrix:", matrix.matrix);
77
77
*
78
78
* // Add two matrices
79
- * const matrix1 = new Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
80
- * const matrix2 = new Matrix([9, 8, 7, 6, 5, 4, 3, 2, 1]);
79
+ * const matrix1 = new p5. Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
80
+ * const matrix2 = new p5. Matrix([9, 8, 7, 6, 5, 4, 3, 2, 1]);
81
81
* matrix1.add(matrix2);
82
82
* console.log("After Addition:", matrix1.matrix); // Output: [10, 10, 10, 10, 10, 10, 10, 10, 10]
83
83
*
84
84
* // Reset the matrix to an identity matrix
85
85
* matrix.reset();
86
- * console.log("Reset Matrix:", matrix.matrix);
86
+ * console.log("Reset p5. Matrix:", matrix.matrix);
87
87
*
88
88
* // Apply a scaling transformation
89
89
* matrix.scale(2, 2, 2);
90
- * console.log("Scaled Matrix:", matrix.matrix);
90
+ * console.log("Scaled p5. Matrix:", matrix.matrix);
91
91
*
92
92
* // Apply a rotation around the X-axis
93
93
* matrix.rotate4x4(Math.PI / 4, 1, 0, 0);
94
- * console.log("Rotated Matrix (X-axis):", matrix.matrix);
94
+ * console.log("Rotated p5. Matrix (X-axis):", matrix.matrix);
95
95
*
96
96
* // Apply a perspective transformation
97
97
* matrix.perspective(Math.PI / 4, 1, 0.1, 100);
98
- * console.log("Perspective Matrix:", matrix.matrix);
98
+ * console.log("Perspective p5. Matrix:", matrix.matrix);
99
99
*
100
100
* // Multiply a vector by the matrix
101
101
* const vector = new Vector(1, 2, 3);
0 commit comments