io7m-com / jtensors

Vector/matrix math package
https://www.io7m.com/software/jtensors/
ISC License
6 stars 1 forks source link

Implement element-wise multiply #24

Closed io7m closed 3 years ago

io7m commented 3 years ago

This was never implemented as it tends not to be that useful in geometric terms. It is useful, however, for working in color spaces.

Vector4D multiply(Vector4D v0, Vector4D v1)
{
  return Vector4D.of(
    v0.x() * v1.x(),
    v0.y() * v1.y(),
    v0.z() * v1.z(),
    v0.w() * v1.w(),
  );
}