function matrixVectorProduct(a, v) {
  var r = [a[0] * v[0] + a[2] * v[1], a[1] * v[0] + a[3] * v[1]];
  if (a.length == 6) {
    r[0] += a[4];
    r[1] += a[5];
  }
  return r;
}
// Handles both 2x2 and 2x3 matrices.
Handles both 2x2 and 2x3 matrices.
Handles both 2x2 and 2x3 matrices .
function matrixVectorProduct(a, v) {
  var r = [a[0] * v[0] + a[2] * v[1], a[1] * v[0] + a[3] * v[1]];
  if (a.length == 6) {
    r[0] += a[4];
    r[1] += a[5];
  }
  return r;
}
function matrixVectorProduct ( a , v ) { var r = [ a [ 0 ] * v [ 0 ] + a [ 2 ] * v [ 1 ] , a [ 1 ] * v [ 0 ] + a [ 3 ] * v [ 1 ] ] ; if ( a . length == 6 ) { r [ 0 ] += a [ 4 ] ; r [ 1 ] += a [ 5 ] ; } return r ; }
Handles both 2x2 and 2x3 matrices.
Handles both 2x2 and 2x3 matrices .