@@ -283,13 +283,13 @@ export class Matrix extends MatrixInterface {
283
283
*
284
284
* const originalMatrix = new p5.Matrix([1, 2, 3, 4]);
285
285
* const copiedMatrix = originalMatrix.get();
286
- * console.log("Original Matrix:", originalMatrix.matrix);
287
- * console.log("Copied Matrix:", copiedMatrix.matrix);
286
+ * console.log("Original Matrix:", originalMatrix.matrix); // Output: [1, 2, 3, 4]
287
+ * console.log("Copied Matrix:", copiedMatrix.matrix); // Output: [1, 2, 3, 4]
288
288
*
289
289
* // Modify the copied matrix
290
290
* copiedMatrix.setElement(2, 99);
291
- * console.log("Modified Copied Matrix:", copiedMatrix.matrix);
292
- * console.log("Original Matrix remains unchanged:", originalMatrix.matrix);
291
+ * console.log("Modified Copied Matrix:", copiedMatrix.matrix); // Output: [1, 2, 99, 4]
292
+ * console.log("Original Matrix remains unchanged:", originalMatrix.matrix); // Output: [1, 2, 3, 4]
293
293
* }
294
294
* </code></div>
295
295
*/
@@ -608,8 +608,8 @@ export class Matrix extends MatrixInterface {
608
608
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
609
609
* const vector = new p5.Vector(1, 2, 3);
610
610
* const result = matrix.multiplyVec(vector);
611
- * console.log("Original Vector:", vector.toString());
612
- * console.log("Transformed Vector:", result.toString());
611
+ * console.log("Original Vector:", vector.toString()); // Output : Original Vector: [1, 2, 3]
612
+ * console.log("Transformed Vector:", result.toString()); // Output : Transformed Vector: [30, 36, 42]
613
613
* }
614
614
* </code></div>
615
615
*/
@@ -1607,19 +1607,19 @@ export class Matrix extends MatrixInterface {
1607
1607
*
1608
1608
* // Define a vector
1609
1609
* const vector = new p5.Vector(1, 2, 3);
1610
- * console.log("Original Vector:", vector.toString());
1610
+ * console.log("Original Vector:", vector.toString()); // Output: [1, 2, 3]
1611
1611
*
1612
1612
* // Apply the matrix to the vector
1613
1613
* const transformedVector = matrix.multiplyVec3(vector);
1614
- * console.log("Transformed Vector:", transformedVector.toString());
1614
+ * console.log("Transformed Vector:", transformedVector.toString()); // Output: [30, 36, 42]
1615
1615
*
1616
1616
* // Modify the matrix (e.g., apply a scaling transformation)
1617
1617
* matrix.scale(2, 2, 2);
1618
- * console.log("Modified Matrix (Scaling):", matrix.matrix);
1618
+ * console.log("Modified Matrix (Scaling):", matrix.matrix); // Output: [2, 4, 6, 8, 10, 12, 14, 16, 18]
1619
1619
*
1620
1620
* // Apply the modified matrix to the same vector
1621
1621
* const scaledVector = matrix.multiplyVec3(vector);
1622
- * console.log("Scaled Vector:", scaledVector.toString());
1622
+ * console.log("Scaled Vector:", scaledVector.toString()); // Output: [60, 72, 84]
1623
1623
* }
1624
1624
* </code></div>
1625
1625
*/
0 commit comments