-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[p5.js 2.0] Vector refactor n-dimentional and Matrix class extraction #7376
base: dev-2.0
Are you sure you want to change the base?
Conversation
[p5.js 2.0] Matrix move to math folder
…nt of p5 namespace
Hi @limzykenneth and @davepagurek this is a refactor of PR #7277 which I turned into a draft to avoid confusion. In this one, the idea is to have most of the changes ready for merging and do incremental updates as needed. I have a question regarding the comment:
|
Resolves #6765
@davepagurek @limzykenneth
Changes:
I have added new inline documentation for the new methods. Here I share the analysis of the pending methods to update and some questions/challenges I'm facing:
Vector methods
Check dimentions?YESComment from Ken regarding serializtionDONE Pending more general serialization.Need to set dimension also?Yes, DONEOnly 3D for now
Updated working for scalar, vector and array, question about different dimension vectors, how should it be handled? should we only divide what is possible and leave the rest unchanged? For example, what to do in this case
[1,2,3]/[8,9]
should it be:[1/8,2/9,3]
or in the other case[8,9]/[1,2,3] =? [8/1, 9/2]
? I've not seen this implementation or inference in any other mathematics library or in general. @limzykenneth @davepagurekNeeds determinantOnly 2D for nowwhy is it call setMag?
maybe because it does it in place
Check
_fromRadians
Only for 2D
Only for 2D
needsonly 3D for nowcross
to be nDProblem with inference of last value being amount for NDOnly 3d for NowProblem with inference of last value being amount for NDOnly 3d for NowIn theory this should return only
this.values
however, this breaks some functionality on the test " p5.RendererGL > color interpolation > geometry with stroke colors use their colors" because of the default always returning a 3 elements array, will retain ad 3D for now but will re-visit_clampToZero
Static methods
Needs module NDOnly 3D for nowneeds rotate NdOnly 3D for nowSee comments in the non static method.
PR Checklist
npm run lint
passes