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
Mark multiply and divide with two vectors as deprecated (Schur product and quotient) #10329
Conversation
These have always seemed odd and near-useless to me too. |
I disagree. Adding or subtracting with a scalar as the second argument can be useful in applications where a radius is provided, and one simply wishes to compute the minimum and maximum positions from a central position. Here's a code snippet from my Protector Redux mod:
It's kind of nice not having to create a temporary vector just for two statements, or to code it verbosely as
In my view, I think having shorthands even if used infrequently can make code easier to understand and maintain. |
When I first saw These two forms should not be deprecated as they are quite useful. For |
Ah, I see, the weird add and sub are used for making cubes. |
Thanks for the good input, i did not think of radii. |
Another problem with the Schur product is that it would not be associative with the matrix product (if we will have it at some point):
I'll remove the change to add and sub. |
According to wikipedia Schur product "appears in lossy compression algorithms such as JPEG". Not likely to have a JPEG compression algorithm in Lua :) |
I reckon that |
You mean |
Nah ... i doubt it is much needed, we could always add one later if users complain. 👍 |
I just noticed the commit and I use
I've been evacuated from my home because of a forest fire for the past week so I apologize for not checking out this PR sooner. |
|
Ah OK, I misunderstood. My apologies. |
Big mistake. I use this to scale vectors (to reverse the effects of visual scale when attaching, for instance). |
There's always the possibility to change the docs again to make the schur product non-deprecated. |
vector.add
with a scalar in the second argument and mul with two vectors (and sub and div) is very unnatural and useless.Who needs the Schur product or quotient or a value added or subbed to/from all components?
I do not think that I have seen them being used in code anywhere.
To do
This PR is a Ready for Review.
How to test
Look at the documentation.