W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2010

[whatwg] Canvas transform() and matrix element notation

From: David Flanagan <david@davidflanagan.com>
Date: Mon, 19 Jul 2010 14:33:01 -0700
Message-ID: <4C44C48D.4040707@davidflanagan.com>
Boris Zbarsky wrote:
> On 7/19/10 4:13 PM, David Flanagan wrote:
>> The spec describes the transform() method as follows:
>>
>>> The transform(m11, m12, m21, m22, dx, dy) method must multiply the
>>> current transformation matrix with the matrix described by:
>>>
>>> m11 m21 dx
>>> m12 m22 dy
>>> 0 0 1
>>
>> The first number in these argument names is the column number and the
>> second is the row number.
> 
> I agree that this is somewhat weird at first glance, but it seems to be 
> not uncommon for graphics libraries.  For example, for cairo the call
> 
>   cairo_matrix_init(m, a, b, c, d, e, f);
> 
> creates a matrix which represents the affine transformation [1]:
> 
>  x_new = a*x + c*y + e;
>  y_new = b*x + d*y + f;
> 

Thanks for checking this; it is nice to know that there is precedent for 
the argument order. Changing the argument names to remove the numbers 
from them would make the spec less confusing.  Or at least changing the 
argument names so that they use (standard?) row,column indexing instead 
of column,row indexing.

     David
Received on Monday, 19 July 2010 14:33:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:25 UTC