// forum.processing.org/two/discussion/10279/how-do-you-use-a-pvector-array
final PVector[] vecs = {
new PVector(),
new PVector(10, 20),
new PVector(TAU, EPSILON, sqrt(3)) };
// display initialized values of each PVector element in the array:
printArray(vecs);
println();
// display 2nd element (index 1):
println(vecs[1]);
// reassign a new PVector object to index 1 thus discarding the old:
vecs[1] = PVector.random3D(this);
println(vecs[1], ENTER);
// access & set new values for the PVector instance in index 0 w/o reassignment:
vecs[0].set(Float.NaN, MAX_FLOAT, DEG_TO_RAD);
println(vecs[0], ENTER);
// display current values after all those changes:
printArray(vecs);
exit();
Answers
Array:
PVector: