title: Java Vector Math readability
body: <p>Let's say you want to do some simple vector calculation:</p>
  
  <pre><code>//this could be C++
  MyVectorType position = ...;
  MyVectorType velocity = ...;
  float dt;
  //Here's the expression I want to calculate:
  position += dt*velocity;
  </code></pre>
  
  <p>Now let's say you want to do this in Java. There's no operator overloading - ok, I can live without.</p>
  
  <pre><code>//this still could be C++
  MyVectorType position = ...;
  MyVectorType velocity = ...;
  float dt;
  //Here's the expression I want to calculate:
  position.add(velocity.times(dt));
  </code></pre>
  
  <p>I would say it's less readable, but still ok. How should I write the code above in Java? I thought I'd use <code>javax.vecmath</code>:</p>
  
  <pre><code>//my attempt in Java
  Vector3f velocity = new Vector3f(...);
  Vector3f position = new Vector3f(...);
  float dt;
  //Here's the expression I want to calculate - three lines.
  Vector3f deltaPosition = new Vector3f(velocity);
  deltaPosition.scale(dt);
  position.add(deltaPosition);
  </code></pre>
  
  <p>Does it really require these three lines to perform such a simple operation? For people being used to reading mathematical expressions I think this is a pain, especially as the operations become more complex. Also, writing such expressions is not really a pleasure.</p>
  
  <p>Am I missing something? Or is there another vector math package that leads to more readable code?</p>