I've got a silly question. I took a vector math class about 10 years ago and could've sworn I remembered an operation that allowed me to multiply the values of a vector together like so:
Vector3 v1 = new Vector3(1, 0, 2)
Vector3 v2 = new Vector3(5, 5, 5)
//Vector3 v3 = SomeVectorOperation(v1, v2) = (1 * 5, 0 * 5, 2 * 5)
Now in reviewing all my notes, and everything I can find online, it doesn't look like this is a common operation at all. Of course I can write a function that does it:
Vector3 VectorMult(Vector3 v1, Vector3 v2) {
return new Vector3(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z);
}
So far I've found at least a few instances where an operation like this would be helpful, so I'm not sure why it wouldn't exist already in some form. So, I guess I have two questions:
- Is there an easier way to get the result I'm looking for than making my own custom function?
- Is there a reason why there is no standard vector operation like this to begin with?
Thank you very much for your time!