From 9f775f4c7c4d013f6cacf196231befb8cb5e25fd Mon Sep 17 00:00:00 2001 From: kit Date: Mon, 11 May 2026 13:14:20 +0200 Subject: [PATCH 1/3] Mark .array() as deprecated --- src/math/p5.Vector.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index cf288f0c42..f5f1960ab1 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -2690,14 +2690,15 @@ class Vector { * Returns the vector's components as an array of numbers. * * @return {Number[]} array with the vector's components. + * @deprecated To retrieve vector components, use `v.values` * @example * // META:norender * function setup() { * // Create a p5.Vector object. * let v = createVector(20, 30); * - * // Prints "[20, 30, 0]" to the console. - * print(v.array()); + * // Prints "[20, 30]" to the console. + * print(v.values); * } */ array() { From 3d173f90e2916e414b1a0242b670f96899e08d7f Mon Sep 17 00:00:00 2001 From: kit Date: Mon, 11 May 2026 13:28:40 +0200 Subject: [PATCH 2/3] Clarify cross product docus --- src/math/p5.Vector.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index f5f1960ab1..7f2b23fd3f 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -1372,6 +1372,9 @@ class Vector { * The cross product is a vector that points straight out of the plane created * by two vectors. The cross product's magnitude is the area of the parallelogram * formed by the original two vectors. + * + * The cross product is defined on 3-dimensional vectors, and will use the `x`, `y`, + * and `z` components. This method should only be used with 3D vectors. * * The static version of `cross()`, as in `p5.Vector.cross(v1, v2)`, is the same * as calling `v1.cross(v2)`. From 93e304ee3cbb35731b087bd51c11f03d8448dbf2 Mon Sep 17 00:00:00 2001 From: kit Date: Mon, 11 May 2026 15:54:28 +0200 Subject: [PATCH 3/3] update to array() docsrtring --- src/math/p5.Vector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/p5.Vector.js b/src/math/p5.Vector.js index 7f2b23fd3f..0bc152162b 100644 --- a/src/math/p5.Vector.js +++ b/src/math/p5.Vector.js @@ -2700,8 +2700,8 @@ class Vector { * // Create a p5.Vector object. * let v = createVector(20, 30); * - * // Prints "[20, 30]" to the console. - * print(v.values); + * // Prints "[20, 30, 0]" to the console. + * print(v.array()); * } */ array() {