[Cuis] Array2D newSize:

Juan Vuletich juan at jvuletich.org
Thu Jul 16 08:16:54 CDT 2015


On 7/15/2015 7:23 PM, Dan Norton wrote:
> Maybe it's my dyslexia, but isn't this backward?
>
> "Array2D newSize: 2 at 3" produces an array with 3 rows and 2 columns:
> | nil nil |
> | nil nil |
> | nil nil |
>
> IMO it should be:
> | nil nil nil |
> | nil nil nil |
>
> For example, in Squeak, "MatrixTransform2x3 identity" produces:
> MatrixTransform2x3(
> 1.0	0.0	0.0
> 0.0	1.0	0.0
> )
>
> Please correct me if I'm wrong.
>
> OK, you're wrong - as long as there is a subclass called Matrix in
>
> LinearAlgebra.pck.st
>
> Use Matrix instead of Array2d.
>
> (whew)

No, you are not wrong.

But use Matrix, or maybe FloatMatrix if it makes sense for you.

Also keep in mind that Cuis has AffineTransformation, that is almost 
identical to Squeak's MatrixTransform2x3 (except for Squeak's doing some 
very arguable rounding to integer of results).

Cheers,
Juan Vuletich




More information about the Cuis mailing list