[2.0] Complete extension of `p5.Vector` to n dimensions
#8158 opened on Oct 15, 2025
Description
[2.0] Complete extension of p5.Vector to n dimensions
Some p5.Vector features have not yet been extended to $n$ dimensions, such as rem(). The purpose of this issue is to extend all such features. We can create sub-sub-issues for action items if multiple features need to be extended and if there are different volunteers for different features.
Tasks:
- Extend
rem()to $n$ dimensions. - Check all other operations to make sure they've been extended, when appropriate.
The first task can be assigned now and is ready for work. The second task can be assigned to the community: if you are reading this and you're able to find another feature that hasn't yet been extended, comment on this issue, and I'll add it to the list (please indicate if you'd like to work on it, or if you'd like another volunteer to do the implementation).
Update: We've mostly or entirely worked out which features need to be extended. I'm working on creating sub-issues for each one. In the meantime, attention may be directed to the following blocking issues:
- #8153: Consensus would clarify the meaning of 2D vs. 3D, in the context of 2.x. (In 1.x, 2D meant $z=0$, but in 2.x, 2D will mean the vector has two elements, pending resolution of this issue.) This is important for extending features that need to distinguish these cases.
- #8155: Consensus on a user-facing API for checking dimension size would enable a more stable implementation of features that operate on specific dimensions, such as
cross(),heading()/setHeading(), androtate().