go-gl/mathgl — pull request #17 by krux02 (2014-06-14 23:41:48+00:00)
Title: Extractors and type converters

First of all, I changed the api of Cols() and Rows() to use non fixed size arrays. The reason for that is, that in a real application, if you want to extract them, you want to give them names, otherwise you could simply keep on working on the matrix directly. Also for the constructors, you almost never have fixed size arrays of vectors in your code, so you would end up typing [N]VecN{...} always when you want to use that constructor. Note that code written in the test cases of Rows/Cols here is not representative for real usage of Rows/Cols.

Then I added methods to resize Vectors and square matrices. Shrinking vectors always keep their beginning, and shrinking matrices always keep ther top left cornes. Growing Vectors have arguments to fill the new elements and Growing Matrices are filled with elements from the Identity Matrix.