Affine transforms - matrix algebra

Pavel Safrata pavel.safrata at
Thu Jul 12 04:58:03 PDT 2012

On 12.7.2012 13:46, Martin Desruisseaux wrote:
> Le 12/07/12 13:40, Martin Desruisseaux a écrit :
>> Yes, I think those methods would be useful. Would it be worth to make 
>> a special case in the getter method like below?
>> if (row == 3) {
>>     return (column == 3) ? 1 : 0;
>> }
>> The setter method would throw an exception on attempt to write a 
>> different value in that row (i.e., the last matrix row would be a 
>> virtual read-only row). The intend is to simulate a complete 4x4 
>> matrix, which can make mathematical operations more natural, 
>> especially when working on arbitrary row/column indices unknown at 
>> compile time.
> Actually such getter method could be placed in the parent Transform 
> class, since every subclasses can return appropriate hard-coded values 
> for any (row,column) indices not associated to one of their fields 
> (omitting the [0 ... 3] range check in this discussion for 
> simplicity). This would allow the users to perform their own matrix 
> calculation on every kind of Transform object.

Correct. All the element getters are already on Transform class so this 
convenient getter definitely belongs there (unlike the setter).

>     Martin

More information about the openjfx-dev mailing list